Difference between revisions of "Nullable"
(External link) |
|||
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]] | [[Category:CommonIdiom]] |