AA's and mutating keys

Paul Findlay r.lph50+d at gmail.com
Wed Oct 31 18:16:16 PDT 2007


Steven Schveighoffer wrote:
> int *x = key in map;
> if(x)
>   (*x)++;
> else
>   map[key.dup] = 1;
That's exactly what I was doing when trying Tim Bray's "Wide Finder" thing
in D. I didn't mind it so much, but I found myself wishing it could do
something like dup the key automatically and insert a default value.

 - Paul


More information about the Digitalmars-d-learn mailing list