Associative arrays in D and default comparators

Sean Kelly sean at f4.ca
Fri Sep 8 00:21:44 PDT 2006


Oskar Linde wrote:
> 
> You would still need to handle the case of identical object hashes.

I've been thinking about this and am wondering if it even makes sense to 
use objects such as threads in an AA.  Address can't even really be used 
for the hash value because of moving GCs, so I'm forced to either store 
the hash value in Thread the first time it's computed or to find some 
other hash to use.  It may simply make more sense to store them in an 
unsorted array.  Note that this is for a ThreadGroup so there will 
likely never be thousands of objects stored that need to be searched 
through.


Sean



More information about the Digitalmars-d mailing list