Optional

Pseudo immutable optional with a value or not.

Constructors

this
this(T payload)

Constructor for pseudo immutable optional.

Alias This

payload

Convenience subtyping.

Members

Functions

opCast
Optional!(const T) opCast()

Return a const version of this optional.

opEquals
bool opEquals(typeof(null) term)

Check whether optional is null or not.

opEquals
bool opEquals(T value)
Undocumented in source. Be warned that the author may not have intended to support it.
orElse
inout(T) orElse(inout(T) alternative)

Get the payload if exists or provide an alternative.

orElseThrow
void orElseThrow(T exception)
Undocumented in source. Be warned that the author may not have intended to support it.
payload
inout(T) payload()

Get the payload hosted in this optional.

Variables

isNull
bool isNull;
Undocumented in source.

Return Value

An optional filled or not with value.

Meta