mapOrElse.mapOrElse

The actual mapOrElse function.

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

Parameters

self
Type: Expected!(T, E, H)

an Expected object

Meta