Single type Nullable
static assert(is(Nullable!int == Variant!(typeof(null), int))); Nullable!int a = 5; assert(a.get!int == 5); a.nullify; assert(a.isNull); a = 4; assert(!a.isNull); assert(a.get == 4); assert(a == 4); a = 4; a = null; assert(a == null);
Empty nullable type set support
Nullable!() a; auto b = a; assert(a.toHash == 0); assert(a == b); assert(a <= b && b >= a); static assert(typeof(a).sizeof == 1);
Nullable Variant Type (aka Algebraic Type).
The impllementation is defined as
In additional to common algebraic API the following members can be accesssed:
Compatible with BetterC mode.