effect of 'const'
does it do anything other than preventing it from being modified, ie any speed increase because of optimizations the compiler can do on it?
I''ve never heard of a speed increase, but it''s good practice, and it''s just good safe programming to use it where it would apply.
For an interesting article on the performance benefits (or lack thereof) of const-correct code, check out GotW #81: Constant Optimization.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement