Difference between revisions of "Nullable"
(Added a basic page for Nullable, to extend later.) |
(External link) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | The module | + | The standard library module [[typecons]] in package [[std]] provides the struct '''Nullable''', which takes a single template argument. This allows for the creation of nullable primitives. |
− | <syntaxhighlight lang="D">Nullable!int maybeIntValue;</syntaxhighlight> | + | <syntaxhighlight lang="D"> |
+ | import std.typecons; | ||
+ | |||
+ | Nullable!int maybeIntValue; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | == External links == | ||
+ | *[https://dlang.org/phobos/std_typecons.html#Nullable std.typecons.Nullable] | ||
+ | |||
+ | [[Category:CommonIdiom]] |