The OpenD Programming Language

StringMap.capacity

(Property) Gets the current capacity of an associative array. The capacity is the size that the underlaynig slices can grow to before the underlying arrays may be reallocated or extended.

Complexity: O(1)

struct StringMap(T)
@safe pure nothrow const @property
size_t
capacity
()
()

Examples

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

Meta