optional.optional

Optional type

Members

Functions

no
auto no()

Type constructor for an optional having no value of T

orElse
U orElse(Optional!T opt, U value)
auto ref orElse(Optional!T opt)

Returns the value contained within the optional _or else_ another value if there's no!T

some
auto ref some(T value)

Type constructor for an optional having some value of T

toNullable
auto toNullable(Optional!T opt)

Turns an Optional in to a Nullable

toOptional
auto toOptional(Nullable!T nullable)

Converts a range or Nullable to an optional type

unwrap
auto ref unwrap(Optional!T opt)

Get pointer to value. If T is a reference type then T is returned

Structs

None
struct None
Undocumented in source.
Optional
struct Optional(T)

Optional type. Also known as a Maybe or Option type in some languages.

Templates

match
template match(handlers...)

Calls an appropriate handler depending on if the optional has a value or not

Variables

none
auto none;

Represents an empty optional value. This is used to set Optionals to have no value or for comparisons

Meta