Hashtable.length

Returns number of key-value pairs.

struct Hashtable(K, V)
@nogc nothrow pure @safe const
size_t
length
()

Return Value

Type: size_t

a positive integer.

Complexity: O(1).

Examples

import std.algorithm.comparison : equal;

auto h = Hashtable!(int, int)();
assert(h.length == 0);
h.insert([1 : 10]);
assert(h.length == 1);

Meta