Associative arrays with void values

bearophile bearophileHUGS at lycos.com
Sun Apr 12 22:45:00 PDT 2009


dsimcha:
> What if the key is a long?

At the moment an AA like this:
byte[long] aa;
allocates 16 or more bytes/pair, so it needs the same memory as:
long[long] aa;

A built-in set can of course use only about 8 bytes (plus few empty cells in the hash) for a:
HashSet!(long)

Bye,
bearophile



More information about the Digitalmars-d mailing list