How can I loop through a C++ map of maps?
Old question but the remaining answers are outdated as of C++11 – you can use a ranged based for loop and simply do: std::map<std::string, std::map<std::string, std::string>> mymap; for(auto const &ent1 : mymap) { // ent1.first is the first key for(auto const &ent2 : ent1.second) { // ent2.first is the second key // ent2.second is the … Read more