222. Walking a Map yields (k, v) pairs in key order (2026-11-22)
- Decision.
for (k, v) in mwalks aMap<K, V>'s entries in ascending key order, the same pairs asm.items. Chapter 7 listsMapasKeyedand a collection but never said what a bare walk yields; the compiler,bench/containers/hash_insert.cpand the lowering tostd::mapall walk pairs, and a walk of values alone would lose the key the contestant almost always needs. - Reverse. Make a bare walk yield values (as
[K]Vdoes) and changespec/conformance/traits/Seq/Map--iter.cpwith it.