Bug 19226 – std.typecons.Nullable(T, T nullValue) doesn't fully handle non-self-equal nullValue

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-09-05T18:09:49Z
Last change time
2019-05-09T15:25:33Z
Keywords
pull
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-09-05T18:09:49Z
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! } ---
Comment #1 by n8sh.secondary — 2018-09-05T18:18:39Z
Comment #2 by n8sh.secondary — 2018-12-15T08:01:39Z
*** Issue 19488 has been marked as a duplicate of this issue. ***
Comment #3 by dlang-bot — 2019-02-23T12:22:13Z
@n8sh updated dlang/phobos pull request #6693 "Fix Issue 19226 - std.typecons.Nullable(T, T nullValue) doesn't fully handle non-self-equal nullValue" fixing this issue: - Fix Issue 19226 - std.typecons.Nullable(T, T nullValue) doesn't fully handle non-self-equal nullValue https://github.com/dlang/phobos/pull/6693
Comment #4 by dlang-bot — 2019-05-09T15:25:33Z
dlang/phobos pull request #6693 "Fix Issue 19226 - std.typecons.Nullable(T, T nullValue) doesn't fully handle non-self-equal nullValue" was merged into master: - aba8660d757e12c3982c8c6427c8e04b6b634ecd by Nathan Sashihara: Fix Issue 19226 - std.typecons.Nullable(T, T nullValue) doesn't fully handle non-self-equal nullValue https://github.com/dlang/phobos/pull/6693