Set.length

Iterates over the $(D_PSYMBOL Set) and counts the elements.

struct Set(T, alias hasher = hash)
@property const
size_t
length
()
if (
isHashFunction!(hasher, T)
)

Return Value

Type: size_t

Count of elements within the $(D_PSYMBOL Set).

Examples

Set!int set;
assert(set.length == 0);

set.insert(8);
assert(set.length == 1);

Meta