mapOrElse.mapOrElse

The actual mapOrElse function.

template mapOrElse(alias valueOp, alias errorOp)
ref
mapOrElse
(
T
E
H
)
(
auto ref Expected!(T, E, H) self
)
if (
is(typeof(errorOp(forwardError!self))) &&
(
(
is(T == void) &&
is(typeof(valueOp()) == typeof(errorOp(forwardError!self)))
)
||
(
!is(T == void) &&
is(typeof(valueOp(self.value)) == typeof(errorOp(forwardError!self)))
)
)
)

Parameters

self Expected!(T, E, H)

an Expected object

Meta