Workarounds for Lack of Mutable Keyword

Craig Black craigblack2 at cox.net
Thu Apr 3 08:52:45 PDT 2008


"Janice Caron" <caron800 at googlemail.com> wrote in message 
news:mailman.304.1207217058.2351.digitalmars-d at puremagic.com...
> On 03/04/2008, Craig Black <craigblack2 at cox.net> wrote:
>>  If that compiles, I think it may be a bug.  Invariant types shouldn't be
>> implicitly convertible to const.
>
> Yes they should.
>
> const means "I promise not to modify this". There is absolutely no
> problem with promising not to modify something which is invariant.

Hmmm.  Maybe you are right.  I was just thinking that since invariant is a 
stronger guarantee than const, it shouldn't be implicitly convertible.  But 
I suppose I agree with you after giving it a little more though. 




More information about the Digitalmars-d mailing list