StringMap.values

Returns a dynamic array, the elements of which are the values in the associative array. Doesn't allocate a new copy.

Complexity: O(1)

struct StringMap(T, U = uint)
@safe pure nothrow @nogc inout @property
inout(T)[]
values
()
()
if (
isMutable!T &&
!__traits(hasMember, T, "opPostMove")
&&
__traits(isUnsigned, U)
)

Examples

StringMap!double map;
assert(map.values == []);
map["c"] = 4.0;
assert(map.values == [4.0]);
map["a"] = 3.0;
assert(map.values == [4.0, 3.0]);
map.values[0]++;
assert(map.values == [5.0, 3.0]);
map.remove("c");
assert(map.values == [3.0]);
map.remove("a");
assert(map.values == []);
map["c"] = 4.0;
assert(map.values == [4.0]);

Meta