isDefaulted

bool
isDefaulted
(
T
)
(
in T a
)

Return Value

Type: bool

true iff a is set to the default/initial value of its type T.

Examples

import std.typecons : Nullable;
auto n = Nullable!(size_t, size_t.max)();
assert(n.isDefaulted);
n = 0;
assert(!n.isDefaulted);
assert(n == 0);
n.reset;
assert(n.isDefaulted);

Meta