Hash Tables in D

Jacob Carlborg via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Jan 6 04:19:45 PST 2016


On 2016-01-05 15:44, Minas Mina wrote:

> It won't, but to use it again you need to allocate a new one (If I'm not
> mistaken).

Not explicitly. I don't know if the runtime allocates a new one. This works:

void main()
{
     auto foo = ["foo" : 1];
     foo = null;
     foo["bar"] = 2;
     assert(foo["bar"] == 2);
}

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list