AAs

Denis Koroskin 2korden at gmail.com
Fri Apr 10 03:02:09 PDT 2009


On Fri, 10 Apr 2009 03:44:06 +0400, Rainer Deyke <rainerd at eldwood.com> wrote:

> bearophile wrote:
>> You are right, there's a problem here, even once you have added an
>> ".idup" to AAs. A hash value isn't data, it's metadata, so you may
>> have a lazily computed mutable metadata of immutable data. Once
>> computed the hash value essentially becomes an immutable.
>
> This sounds like the difference between "logical const" and "physical
> const".  I use the "logical const" features of C++ (along with the
> 'mutable' keyword) in C++ all the time for just this purpose.  For
> better or worse, D has gone the "physical const" route.
>
>

One can still write a Mutable!(T) template and get logical const :)




More information about the Digitalmars-d mailing list