Difference between revisions of "Nullable"

From D Wiki
Jump to: navigation, search
(External link)
 
Line 1: Line 1:
The module ''std.typecons'' provides the struct ''Nullable'', which takes a single template argument. This allows for the creation of nullable primitives.
+
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]]

Latest revision as of 11:08, 14 February 2018

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.

import std.typecons;

Nullable!int maybeIntValue;


External links