Array.empty

Check if the array is empty.

struct Array(T)
@nogc nothrow pure @safe const
bool
empty
()

Return Value

Type: bool

true if there are no elements in the array; false otherwise.

Complexity: O(1).

Examples

Array!int a;
assert(a.empty);
size_t pos = 0;
a.insert(pos, 1);
assert(!a.empty);

Meta