AA clear property

Alex_Dovhal alex_dovhal at yahoo.com
Sat Nov 5 16:15:42 PDT 2011


"Marco Leise" <Marco.Leise at gmx.de> wrote:
> Are you this Alex?
yes.

> As I understand it this function is defined in object_.d which is always 
> imported by default and can be called on an (associative) array through a 
> mechanism called "universal function call", that matches the part before 
> the dot with the first parameter of the function. This only works for 
> arrays. So I believe it is a free function (to invalidate/finalize a 
> variable) and not a property of an array at all.

Thanks for clarification.
So now my question and task changes.
Is there a way to reuse previous memory occupied by AA, when I need to 
change all of it element?
E.g. for dynamic arrays it's possible to make:
dyn_arr.length = 0;
assumeSafeAppend(dyn_arr);
fill_new_values(dyn_arr); 




More information about the Digitalmars-d-learn mailing list