[Issue 13420] double.nan unusable as AA key

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Oct 6 17:04:57 PDT 2014


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

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |code at dawg.eu
         Resolution|---                         |WONTFIX

--- Comment #10 from Martin Nowak <code at dawg.eu> ---
> 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.

> b) float.compare(x, y) can return -1 or 1 even when x or y is inf or nan!
> 
> I think we need another bug report for b)... (will add)

Reference?

--


More information about the Digitalmars-d-bugs mailing list