Expected.valueOr

Get current value if any or call function elseWorkFun with compatible return value.

TODO: is this anywhere near what we want?

struct Expected(T, E = Exception)
const
CommonType!(T, typeof(elseWorkFun()))
valueOr
(
alias elseWorkFun
)
()
if (
is(CommonType!(T, typeof(elseWorkFun())))
)
if (
!is(T == Unexpected!(_),
_
) &&
!is(T == void)
)

Meta