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(T val)
  2. this(const(T) val)
  3. this(immutable(T) val)
  4. this(const(T) val)
  5. this(immutable(T) val)
  6. this(E val, bool success)
  7. this(const(E) val, bool success)
  8. this(immutable(E) val, bool success)
    struct Expected(T, E = string, Hook = Abort)
    immutable
    static if(Types.length == 1 && !is(T == void))
    static if(isCopyable!E)
    this
    ()
    (
    auto ref immutable(E) val
    ,
    bool success
    )
    if (
    !is(E == void)
    )
  9. this(const(E) val, bool success)
  10. this(immutable(E) val, bool success)
  11. this()

Parameters

val immutable(E)

Value to set as value or error

success bool

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

Meta