On 09/02/2012 04:23 PM, Pavel Sanda wrote:
Scott Kostyshak wrote:
(3) I've read that compilers can apply more aggressive optimizations when more
of the data is const.  I'm not sure if this would apply here and even if it did
That was my question because I don't think there is any difference here.
The fact that end is not modified anywhere in the loop will be quickly
discovered by compiler optimizations anyway.

I generally prefer to see const wherever it is possible, if only because it functions like documentation. Whoever wrote the code is telling me this variable will not change its value, etc.

Richard

Reply via email to