The OpenD Programming Language

StringMap.byKeyValue

Return a range over all elements (key-values pairs) currently stored in the associative array.

The elements returned are guaranteed to be in the ordered inserted as long as no key removals nor no value mutations has been performed.

struct StringMap(T)
@trusted pure nothrow @nogc
byKeyValue
(
this This
)
()

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