How to clear associative array

Steven Schveighoffer schveiguy at yahoo.com
Fri Aug 1 12:47:35 PDT 2008


"BCS" wrote
> Reply to Zarathustra,
>
>> As in subject.
>>
>> Type [KeyType] array;
>>
>> array[new KeyType(...)] = new Type(...);
>> ...
>> delete array; // error
>>
>
> I'm not sure how array=null will interact with other references to the 
> same AA.

AA's are objects, so multiple references to the same AA would result in the 
data being retained for the references that you did not set to null.

It would be nice to have a .clear function so you could deal with removing 
all elements when multiple references are used.

-Steve 




More information about the Digitalmars-d-learn mailing list