Expected.this

Constructs an Expected with value or error based on the provided flag. This constructor is available only for cases when value and error has the same type, so we can still construct Expected with value or error.

  1. this(CT val)
  2. this(E val, bool success)
    struct Expected(T, E = string, Hook = Abort)
    static if(Types.length == 1 && !is(T == void))
    this
    ()
    (
    auto ref E val
    ,
    bool success
    )
    if (
    !is(E == void) &&
    (
    !is(T == void)
    )
    )
  3. this()

Parameters

val E

Value to set as value or error

success bool

If true, Expected with value is created, Expected with error otherwise.

Meta