fmapOr

Undocumented in source.
template fmapOr(alias pred)
fmapOr
(
U
T
)
(
auto ref scope Optional!T optional
,
auto ref scope U other
)

Members

Functions

fmapOr
auto fmapOr(Optional!T optional, U other)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

auto x = Optional!string.some("foo");
assert(x.fmapOr!(str => str.length)(42) == 3);

auto y = Optional!string.none();
assert(y.fmapOr!(str => str.length)(42) == 42);

Meta