List.length

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

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

Examples

List!(int) list = null;
assert(list.length == 0);

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

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

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

Meta