Clearing associative arrays

Martin Fuchs martin-fuchs at gmx.net
Tue Sep 18 00:12:04 PDT 2007


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); 





More information about the Digitalmars-d mailing list