Expected.apply

If this is an expected value (of type T) apply fun on it and return result, otherwise return current unexpected value (of type E).

struct Expected(T, E = Exception)
@trusted => hasExpectedValue ? typeof(return)(unaryFun!fun(_expectedValue)) : typeof(return)(Unexpected!E(_unexpectedValue))
Expected!(typeof(unaryFun!fun(T.init)), E)
apply
(
alias fun
)
()
if (
!isInstanceOf!(Unexpected, T) &&
!is(T == void)
)

See Also

Meta