const

Walter Bright newshound1 at digitalmars.com
Fri Mar 28 20:25:57 PDT 2008


Scott S. McCoy wrote:
> I have to ask, what's the difference between a const view into an 
> immutable value, and a const view into an invariant value?  Nothing 
> right...so since you can't modify data from a const view of the data, 
> and an invariant is a thing that can't be modified, shouldn't you be 
> able to seamlessly promote an invariant to const, with no side effects?

Yes, invariants can be implicitly converted to const.



More information about the Digitalmars-d mailing list