September 05, 2018 [Issue 19226] New: std.typecons.Nullable(T, T nullValue) doesn't fully handle non-self-equal nullValue | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19226 Issue ID: 19226 Summary: std.typecons.Nullable(T, T nullValue) doesn't fully handle non-self-equal nullValue Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: n8sh.secondary@hotmail.com Nullable(T, T nullValue) special-cases floating point numbers but this doesn't account for all types where nullValue != nullValue. For instance: https://run.dlang.io/is/hiLncI --- struct S { float f; } void main() { import std.typecons : Nullable; alias N = Nullable!(S, S.init); assert(N(S.init).isNull); // Fails! } --- -- |
Copyright © 1999-2021 by the D Language Foundation