float price; if (price == float.nan) { // initialized } else { // uninitialized } ... valid ?
Vladimir Panteleev
thecybershadow.lists at gmail.com
Wed Jun 30 03:55:05 UTC 2021
On Wednesday, 30 June 2021 at 03:52:51 UTC, someone wrote:
> One of the things I do not like with D, and it causes me to
> shoot me on the foot over and over, is the lack of null for
> *every* data type. Things like:
If you want to give any type a "null" value, you could use
[`std.typecons.Nullable`](https://dlang.org/library/std/typecons/nullable.html).
More information about the Digitalmars-d-learn
mailing list