Immutable fields

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Nov 7 17:13:51 PST 2010


On 11/7/10 2:40 PM, Stewart Gordon wrote:
> On 03/11/2010 03:06, Daniel Murphy wrote:
>> "bearophile"<bearophileHUGS at lycos.com> wrote in message
>> news:iaqbsb$1d30$1 at digitalmars.com...
>>> Is it correct for immutable struct fields to act like enum or static
>>> const
>>> fields? (I don't think so, but I am wrong often):
>>
>> immutable struct fields can be changed inside the constructor, so they
>> must
>> be non-static.
> <snip>
>
> Const/immutable struct members are an ugly mess, and a big hole in the
> const system.
>
> http://d.puremagic.com/issues/show_bug.cgi?id=2625
>
> Stewart.

There are problems with the implementation, not the design. Fixing const 
and immutable will be #1 priority once the 64-bit dmd is off the gates.

Andrei


More information about the Digitalmars-d mailing list