range

Create an OptionRange from an Option type.

The range shall be empty when the option has no value, and it shall have one item when the option has a value.

  1. OptionRange!T range(Option!T optionalValue)
  2. OptionRange!(const(T)) range(const(Option!T) optionalValue)
    @nogc @trusted pure nothrow
    OptionRange!(const(T))
    range
    (
    T
    )
  3. OptionRange!(immutable(T)) range(immutable(Option!T) optionalValue)

Parameters

optionalValue
Type: const(Option!T)

An optional value.

Return Value

Type: OptionRange!(const(T))

A range of 0 or 1 values.

Meta