map

Apply a function over a Nullable's contents, if it is not null, and return that as a new Nullable. If the argument is null, return a null Nullable.

map
(
alias pred
T
)
(
auto ref Nullable!T value
)
if (
is(typeof(pred(value.get())))
)

Examples

t
{
	assert(Nullable!int( ).map!(n => n+1).isNull);
	assert(Nullable!int(1).map!(n => n+1).get() == 2

Meta