Thread overview | |||||
---|---|---|---|---|---|
|
December 12, 2004 why no .dup for associative arrays? | ||||
---|---|---|---|---|
| ||||
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? |
December 12, 2004 Re: why no .dup for associative arrays? | ||||
---|---|---|---|---|
| ||||
Posted in reply to no | 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
|
December 13, 2004 Re: why no .dup for associative arrays? | ||||
---|---|---|---|---|
| ||||
Posted in reply to no | <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. |
Copyright © 1999-2021 by the D Language Foundation