samedi 25 juillet 2015

Clarification of iterating through maps using for(auto iter : value)

I know that in order to loop through a map in C++11 I can use the following code:

std::mymap<std::string, myclass>

for(auto iter : mymap)
{
    // code here
}

What exactly is referred to by iter? Is it the map key? The value that is currently accessed? If I want to do something with the value, how do I access it?

Aucun commentaire:

Enregistrer un commentaire