effect of 'const'

Started by
2 comments, last by billybob 21 years, 2 months ago
does it do anything other than preventing it from being modified, ie any speed increase because of optimizations the compiler can do on it?
Advertisement
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.
type checking
Nothing to do, try complimenting someone, it will make you feel better!
For an interesting article on the performance benefits (or lack thereof) of const-correct code, check out GotW #81: Constant Optimization.
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers

This topic is closed to new replies.

Advertisement