digitalmars.D - why no .dup for associative arrays?
- no where.com (10/10) Dec 12 2004 int main()
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (5/9) Dec 12 2004 There is no static init for AA either, I think (guess)
- Walter (3/13) Dec 12 2004 Essentially because it never occurred to me :-(
int main()
{
int[int] map, m2;
map[0]++;
m2 = map.dup;
return 0;
}
map.d:7: no property 'dup' for type 'int[int]'
What's the reason for this, why associative array is different from other
objects?
Dec 12 2004
no where.com wrote:map.d:7: no property 'dup' for type 'int[int]' What's the reason for this, why associative array is different from other objects?There is no static init for AA either, I think (guess) one reason is that the internal format is not fixed ? So it's probably a "bug". Probably known, but anyway. --anders
Dec 12 2004
<no where.com> wrote in message news:cpi6p0$2lik$1 digitaldaemon.com...
int main()
{
int[int] map, m2;
map[0]++;
m2 = map.dup;
return 0;
}
map.d:7: no property 'dup' for type 'int[int]'
What's the reason for this, why associative array is different from other
objects?
Essentially because it never occurred to me :-(
The .dup would come in handy for some kinds of lock-free data structures.
Dec 12 2004









=?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> 