Iterate over Dictionary (C++ unordered_map)
C++17
unordered_map<int,string> hash;
for( auto& [k,v]: hash) { // C++17
...
}
unordered_map<int,string> hash;
for( auto& [k,v]: hash | std::views::reverse) { // C++20
...
}
Written on February 1, 2021, Last update on December 17, 2022
c++
loop
iterate
dictionary
tuple
hash