Nullable!int empty; Nullable!int a = 42; Nullable!int b = 42; Nullable!int c = 27; assert(empty == empty); assert(empty == Nullable!int.init); assert(empty != a); assert(empty != b); assert(empty != c); assert(a == b); assert(a != c); assert(empty != 42); assert(a == 42); assert(c != 42);
If they are both null, then they are equal. If one is null and the other is not, then they are not equal. If they are both non-null, then they are equal if their values are equal.