defaultNullKeyConstantOf

Default null key of type T,

template defaultNullKeyConstantOf (
T
) {}

Members

Manifest constants

defaultNullKeyConstantOf
enum defaultNullKeyConstantOf;
Undocumented in source.

Examples

import std.typecons : Nullable;

static assert(defaultNullKeyConstantOf!(void*) == null);

alias Ni = Nullable!int;
static assert(defaultNullKeyConstantOf!(Ni) == Ni.init);

// alias cNi = const(Nullable!int);
// static assert(defaultNullKeyConstantOf!(cNi) == cNi.init);

alias NubM = Nullable!(ubyte, ubyte.max);
assert(defaultNullKeyConstantOf!(NubM).isNull);

alias NuiM = Nullable!(uint, uint.max);
assert(defaultNullKeyConstantOf!(NuiM).isNull);

const Nullable!(uint, uint.max) x = 13;
assert(!x.isNull);
const y = x;
assert(!y.isNull);
assert(!x.isNull);

Meta