YamlMap map = ["a" : 1]; assert(map["a"] == 1); map[1.YamlAlgebraic] = "a"; map["a"] = 3; map["a"].get!long++; map["a"].get!"integer" += 3; map["a"].integer += 3; assert(map["a"] == 10); assert(map[1.YamlAlgebraic] == "a"); // foreach iteration long sum; foreach (ref key, ref value; map) if (key == "a") sum += value.get!long; assert(sum == 10);
YAML map representation.
The implementation preserves order and allows duplicated keys.