Does const-correctness give the compiler more room for optimization?
I know that it improves readability and makes the program less error-prone, but how much does it improve the performance? And on a side note, what's the major difference between a reference and a const pointer? I would assume they're stored in the memory differently, but how so? Nemo [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