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(auto ref CT val)
  2. this(auto ref E val, bool success)
    struct Expected(T, E = string, Hook = Abort)
    this
    ()
    (
    auto ref E val
    ,
    bool success
    )
    if (
    !is(E == void) &&
    (
    !is(T == void)
    )
    )

Parameters

val
Type: E

Value to set as value or error

success
Type: bool

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

Meta