On Saturday, 13 April 2013 at 09:09:36 UTC, Nicolas Guillemot wrote:
Hey gedaiu,

I'm still a novice to D, but here are some solutions I found. They can probably be improved.

1) Assigning to it an empty map
https://ideone.com/h7ffmD

2) Removing all entries
https://ideone.com/E7k2WL

My guess is that the first method is more efficient. I wish I knew how to do it without having to explicitly declare the "empty" variable.

Cheers.

Hi,

string[string] empty;
values = empty;

looks great, but i cleared the array like this:

values = null;

and it seems it works great. But, i don't know how correct is this... I was expecting to have a clear() method on array.

Thanks,
Bogdan

Reply via email to