Associative Array c'tor

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 12 06:01:20 PDT 2016


On Tuesday, 12 July 2016 at 12:34:40 UTC, Steven Schveighoffer 
wrote:
> There was a suggestion to make .clear (a relatively new 
> feature) actually preallocate if it's currently null, but I 
> didn't want to do allocating in that method (too surprising). I 
> do think it would be nice to have an initializer function that 
> simply allocates the impl.

q&n patch[1]. it adds template arg to `.clear`, so no code 
breakage here (old `clear` is still not allocate, but 
`.clear!true` will).


[1] https://issues.dlang.org/show_bug.cgi?id=16269


More information about the Digitalmars-d-learn mailing list