Profiling
René Zwanenburg
renezwanenburg at gmail.com
Wed Aug 25 13:26:09 UTC 2021
On Tuesday, 24 August 2021 at 10:33:07 UTC, JG wrote:
> The reason for the crash boils down to the fact that this fails:
>
> foreach(k; sort!"a > b"(funcs.keys)) assert(k in funcs);
>
> funcs is of type ubyte[4][float]
>
> Is this a compiler bug?
That assert will fail if there are NaN keys in the AA. This for
example will print null:
```d
bool[float] aa;
aa[float.nan] = true;
writeln(float.nan in aa);
```
Sort may also act funny when NaNs are involved, not sure about
that.
More information about the Digitalmars-d-learn
mailing list