Struct hash issues with string fields

Ali Çehreli acehreli at yahoo.com
Sat May 26 17:19:50 PDT 2012


On 05/26/2012 05:13 PM, Ali Çehreli wrote:

 > once you define toHash(), you
 > must also define opCmp() and opEquals() that are all consistent with
 > each other.

Correction: opEquals() is only for potential optimizations. What is 
needed alongside toHash() is just opCmp(), and the reason is to be able 
to resolve hash collisions.

Ali



More information about the Digitalmars-d-learn mailing list