[Issue 13420] double.nan unusable as AA key

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Dec 7 06:19:19 PST 2014


https://issues.dlang.org/show_bug.cgi?id=13420

--- Comment #12 from Marc Schütz <schuetzm at gmx.net> ---
(In reply to Martin Nowak from comment #10)
> > Maybe the AA implementation should assert that keys added to it should be equal to themselves.
> 
> Sorry for breaking your code, but this check seems exaggerated.
> An AA implementation has to rely on a working equality comparison and hash.
> 
> As floats are builtin types we should special case the AA implementation to
> perform some extra checks, e.g. disallow NaN as key value.
> See bug 13581 for an enhancement request.
> 

I don't think we should special-case floats. As you said, AA has to rely on a
working equality comparison and hash, and the way to verify that is to use an
assert.

--


More information about the Digitalmars-d-bugs mailing list