Comment #0 by dlang-bugzilla — 2007-01-07T19:08:39Z
Since associative arrays are reference types, the language currently doesn't provide a straight-forward way to duplicate an associative array. As a small enhancement towards general language consistency, I would like to suggest a .dup property, like for dynamic arrays, which returns a copy of the associative array.
Comment #1 by wbaxter — 2007-04-25T20:26:28Z
I second that. I was surprised to find out just now when the compiler told me it didn't exist for AAs.
(Is there a workaround? Does assigning to another AA make a copy?)
Comment #2 by dlang-bugzilla — 2007-04-25T20:28:01Z
The "workaround" is:
foreach(key,value;aa1)aa2[key]=value;
This can easily be made into a template function.