Behaviour of AAs after initialization

via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 7 10:42:28 PDT 2014


On Thursday, 7 August 2014 at 17:35:46 UTC, Puming wrote:
> So I'd like to suggest a rule here similar to what assignment 
> does to null AA:
>
> If someone refers to an uninitialized null AA ( in 
> implementation, that maybe, a copy of a null AA struct 
> happens), allocate it first.

I'm afraid that copying is too general. This would trigger on 
just about any access. It would also make copying AAs more 
expensive. I believe a standardized method for initializing an AA 
is more likely to be accepted.


More information about the Digitalmars-d mailing list