Struct hash issues with string fields
Andrej Mitrovic
andrej.mitrovich at gmail.com
Sun May 27 04:22:11 PDT 2012
On 5/27/12, Ali Çehreli <acehreli at yahoo.com> wrote:
> 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.
Thanks! Is this documented somewhere on dlang.org?
More information about the Digitalmars-d-learn
mailing list