Difference between revisions of "Nullable"

From D Wiki
Jump to: navigation, search
(Added a basic page for Nullable, to extend later.)
 
Line 2: Line 2:
  
 
<syntaxhighlight lang="D">Nullable!int maybeIntValue;</syntaxhighlight>
 
<syntaxhighlight lang="D">Nullable!int maybeIntValue;</syntaxhighlight>
 +
 +
[[Category:CommonIdiom]]

Revision as of 20:05, 8 September 2015

The module std.typecons provides the struct Nullable, which takes a single template argument. This allows for the creation of nullable primitives.

Nullable!int maybeIntValue;