Option.getOr

Gets the value stored within the Optional if valid, otherwise returns the given value.

struct Option(T)
@nogc @trusted nothrow
T
getOr
(
T value = T.init
)

Parameters

value T

The value to return if the optional is invalid.

Return Value

Type: T

The value stored within the Optional, value otherwise.

Meta