The OpenD Programming Language

StringMap.empty

struct StringMap(T)
@safe pure nothrow @nogc const @property
bool
empty
()
()

Return Value

Type: bool

number of elements in the table.

Examples

StringMap!double map;
assert(map.length == 0);
map["a"] = 3.0;
assert(map.length == 1);
map["c"] = 4.0;
assert(map.length == 2);
assert(map.remove("c"));
assert(map.length == 1);
assert(!map.remove("c"));
assert(map.length == 1);
assert(map.remove("a"));
assert(map.length == 0);

Meta