Why Does Dscanner Warn About a Missing toHash if opEquals is Defined?

Jack Stouffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 31 09:39:59 PDT 2016


On Sunday, 31 July 2016 at 15:30:15 UTC, LaTeigne wrote:
> On Sunday, 31 July 2016 at 15:21:01 UTC, Jack Stouffer wrote:
>> Is it really a problem? What are the pitfalls of defining one 
>> but not the other?
>
> iirc usage in an AA requires both.

But D provides a default toHash for every type if it's not 
defined. I was wondering why not just rely on that version.


More information about the Digitalmars-d-learn mailing list