C++ Container equivalents
Brad Roberts
braddr at puremagic.com
Wed Aug 15 11:45:09 PDT 2007
On Wed, 15 Aug 2007, Jascha Wetzel wrote:
> Bruce Adams wrote:
> > Hashmap "Unlike DMD's dodgy associative array implementation, it doesn't
> > rely on an ordering comparator"
> >
> > What's wrong with std.date and whats dodgey about associative arrays?
>
> what he means is probably that a hash table implementation doesn't need an
> ordering comparator, only equality. D's associative arrays are implemented as
> binary search trees with hash keys as index values. like this it needs both:
> ordering for the tree search and equality due to the non-injective hashing.
Careful, that's not quite correct. D's builtin associate arrays use a
binary-tree only for buckets, not for the entire table. The requirement
is the same, but the suggestion that it's not a hash table but rather a
simple binary-tree isn't correct.
Later,
Brad
More information about the Digitalmars-d-learn
mailing list