View source code Display the source code in std/typecons.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

Struct std.typecons.NullableRef

Just like Nullable!T, except that the object refers to a value sitting elsewhere in memory. This makes assignments overwrite the initially assigned value. Internally NullableRef!T only stores a pointer to T (i.e., Nullable!T.sizeof == (T*).sizeof).

Constructors

Name Description
this Constructor binding this to value.

Properties

Name Type Description
get [get] inout(T) Gets the value. this must not be in the null state. This function is also called for the implicit conversion to T.
isNull [get] bool Returns true if and only if this is in the null state.

Methods

Name Description
bind Binds the internal state to value.
nullify Forces this to the null state.

Templates

Name Description
opAssign Assigns value to the internally-held state.

Authors

Andrei Alexandrescu, Bartosz Milewski, Don Clugston, Shin Fujishiro, Kenji Hara

License

Boost License 1.0.

Comments