What does it mean for opCmp and opEquals to be consistent?

w0rp devw0rp at gmail.com
Thu Apr 3 05:41:48 PDT 2014


On Thursday, 3 April 2014 at 10:42:33 UTC, monarch_dodra wrote:
> A correctly implemented AA would use opCmp to store objects in 
> each bucket in cases of hash collisions, but still use opEqual 
> in case of equivalence.

I would add to that, "try to use opCmp if it is available." It 
should be possible to hash something if it has toHash and 
opEquals, and not require opCmp for hashing.


More information about the Digitalmars-d-learn mailing list