Function some

Type constructor for an optional having some value of T

auto some(T) (
  auto ref T value
);

Example

import std.range: only;
import std.algorithm: equal;

auto a = no!int;
assert(a == none);
a = 9;
assert(a == some(9));
assert(a != none);

import std.algorithm: map;
assert(only(1, 2, 3).map!some.equal(only(some(1), some(2), some(3))));