Vector.length

Returns the length of the vector, in terms of number of elements.

This is the number of actual elements that conform the contents of the Vector, which is not necessarily equal to its storage capacity.

struct Vector
@property const scope pure nothrow @safe @nogc
size_t
length
()

Examples

Vector!(int, 10) vec = null;
assert(vec.length == 0);

vec.append(42);
assert(vec.length == 1);

vec.append(123);
assert(vec.length == 2);

vec.clear();
assert(vec.length == 0);

Meta