empty

Tests whether array is empty.

@property
bool
empty
(
T
)
(
scope const T[] array
)

Parameters

T

Element type of array.

array T[]

Built-in array.

Return Value

Type: bool

$(D_KEYWORD true) if array has no elements, $(D_KEYWORD false) otherwise.

Examples

int[1] array;
assert(!array.empty);
assert(array[1 .. 1].empty);

Meta