samedi 17 février 2018

Increment int in an unordered_map?

int c = counts.at(v).at(id);
std::cout << c;
counts.at(v).emplace(id,c+1);
std::cout << counts.at(v).at(id);

counts is an unordered_map of unordered_map. The first cout prints 1, the second prints 1, why it is not incremented ?

Aucun commentaire:

Enregistrer un commentaire