Does const-correctness give the compiler more room for optimization?
[Edit: OK so this question is more subtle than I thought at first.] Declaring a pointer-to-const or reference-of-const never helps any compiler to optimize anything. (Although see the Update at the bottom of this answer.) The const declaration only indicates how an identifier will be used within the scope of its declaration; it does not … Read more