On 01/02/2015 10:10 PM, ted wrote:

> I'm now taking the view that const is there for the compiler to optimise
> code on the basis that nothing can alter it once set (and can only be set
> on initialisation).

Of course, that is true for const values, not for const references. In the latter case it means "I will not modify but others may modify", so the optimization that you mention does not apply to const in general. However, immutable can be used for optimization.

Ali

Reply via email to