Rust Optimizations That C++ Can't Do
Errr, C++ can do this.
It just requires analysis to do it in some cases (not all).<p>As a trivial example, the point about const is  wrong (at least as far as i understand it).
you can const cast stuff, but you still can&#x27;t modify it, to do so is UB:
Modifying a const object through a non-const access path and referring to a volatile object through a non-volatile glvalue both result in undefined behavior.
So yeah.<p>As for the abi, any abi arguments are silly.
really.
the compiler can always clone the function, rename it, and do what you want.
or inline it.
or ....<p>If it really matters, you&#x27;d also just change the ABI.
There is no C++ standard ABI.
There&#x27;s one a lot of compilers use.
If we could get x% better performance using a different one, people would do that :)<p>The corollary is &quot;If you think you can only get x% better performance by doing that, you are probably wrong&quot;.<p>(I&#x27;m excluding things that are low level abis, like x32, etc, since we are talking about language abis)