Robustness of the built in associative array

Nick Nick_member at pathlink.com
Sat Mar 25 01:43:12 PST 2006


In article <e01a21$te2$5 at digitaldaemon.com>, Oskar Linde says...
>
>Is there any way to retain the syntax and ease of use of the built in AA 
>with a library implementation allowing the flexibility of choosing:
>- implementation
>- hash function
>- comparison function
>?

I think the STL containers do a very good job at being both flexible and usable,
covering most normal cases of use. The thing missing from D to make a STL-like
library would be the reference return type.

Some of the syntax would still be impossible to duplicate, eg.

int[int] ii;
ii[1]++; // This inserts the key '1'
int i = ii[2]; // This does NOT insert '2'

but I always thought this was the wrong way to do it anyway. (Eg. what should
happen when the value is a struct and you use ii[3].foo?)

Nick





More information about the Digitalmars-d mailing list