mardi 21 avril 2020

How to print the content of a nested std::unordered_map?

I'm trying to print all the content of an std::unordered_map specified like this:

std::unordered_map<uint64_t, std::unordered_map<uint64_t,uint64_t>> m;

After adding things in the map, I tried the following:

for (auto it=map.begin(); it!=map.end(); it++) {
    cout << it->first << it->second << endl;
}

but it is not working.

Aucun commentaire:

Enregistrer un commentaire