Clearing associative arrays
Bill Baxter
dnewsgroup at billbaxter.com
Tue Sep 18 00:19:53 PDT 2007
Martin Fuchs wrote:
> Is there a direct way to clear the content of associative arrays in one
> step?
> I would expect a statement like "arr.clear();", "arr.erase();" or
> "arr.removeall();" to do the work, but couldn't find one.
> Instead it seams I would have to use the following wordy an inefficient
> approach:
>
> foreach(x; arr)
> arr.remove(x);
>
>
"arr = null" or "arr = arr.init" works.
http://www.prowiki.org/wiki4d/wiki.cgi?action=edit&id=DocComments/Arrays§ion=16
(Check those "Comments" link pages on the doc whenever you don't see
something in the doc that you should be there)
--bb
More information about the Digitalmars-d
mailing list