do "const" declarations help the compiler (GCC) produce faster code?

Viewed 6963

Do const declarations help the compiler (GCC) produce faster code or are they only useful for readability and correctness?

Zed Shaw has argued that const is useless or is overused in C/C++:

Next is all the bizarre fascination with const. For some odd reason C++ loves to make you slap const on every part of a declaration, and yet I get the same end result as C: a function is called. (...)

(From: http://librelist.com/browser//mongrel2/2010/7/15/c-verses-c++/#770d94bcfc6ddf1d8510199996b607dd )

4 Answers
Related