isNullable

Is true iff T is type with a predefined undefined (null) value.

Members

Manifest constants

isNullable
enum isNullable;
Undocumented in source.
isNullable
enum isNullable;
Undocumented in source.
isNullable
enum isNullable;
Undocumented in source.
isNullable
enum isNullable;
Undocumented in source.
isNullable
enum isNullable;
Undocumented in source.
isNullable
enum isNullable;
Undocumented in source.

Examples

import std.typecons : Nullable;

class C {}

static assert( isNullable!(C));
static assert( isNullable!(int*));
static assert( isNullable!(int[]));
static assert( isNullable!(const(int)[]));
static assert(!isNullable!(int[3]));
static assert( isNullable!(string));
static assert( isNullable!(Nullable!int));
static assert(!isNullable!(int));

struct S
{
	int value;
	static immutable nullValue = typeof(this).init;
}

struct S2 { C x, y; }
static assert(!isNullable!S2);

struct S3 { int x, y; }
static assert(!isNullable!S3);

struct S4 { C x, y; alias nullifier = x; }
static assert(isNullable!S4);

Meta