www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How do you duplicate an AA?

reply stonecobra <scott stonecobra.com> writes:
I have an AA, and I cannot call aa.dup, as the compiler says:

No property 'dup' for 'char[][char[]]'

How can I do it?

Scott
Aug 04 2004
parent Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
stonecobra wrote:
 I have an AA, and I cannot call aa.dup, as the compiler says:
 
 No property 'dup' for 'char[][char[]]'
 
 How can I do it?

dup would be nice, but you can also do this: char[][char[]] a = <whatever>; char[][char[]] copy; foreach(char[] key, char[] value; a) copy[key] = value;
Aug 05 2004