HashTable.length

Returns the number of elements in the container.

struct HashTable(Key, Value, alias hasher = hash)
@property const
size_t
length
()
if (
isHashFunction!(hasher, Key)
)

Return Value

Type: size_t

The number of elements in the container.

Examples

HashTable!(string, int) hashTable;
assert(hashTable.length == 0);

hashTable["eight"] = 8;
assert(hashTable.length == 1);

Meta