Default hashing function for AA's

Per Nordlöw per.nordlow at gmail.com
Mon Oct 9 14:48:57 UTC 2017


On Monday, 9 October 2017 at 14:11:13 UTC, RazvanN wrote:
> We in the UPB dlang group have been having discussions about 
> the hashing functions of associative arrays. In particular, we 
> were wondering why is the AA implementation in druntime is not 
> using the hash function implemented in 
> druntime/src/core/internal/hash.hashOf for classes that don't 
> define toHash().
>
> For us, that seems to be a very good default hashing function.

Further, I haven't found any instructions on changing the default 
hash-digest for `hashOf`. Is this in conflict with `hashOf` being 
`pure`? Could the interface to builtin AA's be extended to 
support changing the default hash algorithm (which in turn 
`hashOf` will use) upon AA instantiation?


More information about the Digitalmars-d mailing list