Nullable

Undocumented in source.

Constructors

this
this(T value)

Constructor initializing this with value.

Destructor

~this
~this()
Undocumented in source.

Alias This

get_

Implicitly converts to T. this must not be in the null state. This feature is deprecated and will be removed after 2.096.

Members

Functions

nullify
void nullify()

Forces this to the null state.

opAssign
void opAssign(T value)

Assigns value to the internally-held state. If the assignment succeeds, this becomes non-null.

opAssign
void opAssign(Nullable!T value)

If value is null, sets this to null, otherwise assigns value.get to the internally-held state. If the assignment succeeds, this becomes non-null.

opEquals
bool opEquals(const(typeof(this)) rhs)
bool opEquals(const(U) rhs)

If they are both null, then they are equal. If one is null and the other is not, then they are not equal. If they are both non-null, then they are equal if their values are equal.

toHash
size_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
void toString(W writer, FormatSpec!char fmt)

Gives the string "Nullable.null" if isNull is true. Otherwise, the result is equivalent to calling std.format.formattedWrite on the underlying value.

Properties

get
inout(T) get [@property getter]
inout(T) get [@property setter]
inout(U) get [@property setter]

Gets the value if not null. If this is in the null state, and the optional parameter fallback was provided, it will be returned. Without fallback, calling get with a null state is invalid.

get_
deprecated inout(T) get_ [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
isNull
bool isNull [@property getter]

Check if this is in the null state.

Meta