orElse

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

  1. U orElse(Optional!T opt, U value)
  2. auto ref orElse(Optional!T opt)
    ref
    orElse
    (
    alias pred
    T
    )
    (
    inout auto ref Optional!T opt
    )
    if (
    is(typeof(pred()) : T)
    )

Parameters

opt Optional!T

the optional to call orElse on

pred

The predicate to call if the optional is empty

Meta