mercredi 1 avril 2015

Using iterator for removing items from map in c++


map<int, int> m_map;
map::iterator it = m_map.begin();
while (it != m_map.end())
{
m_map.erase(it++);
}


When dose the ++ action preform? after the erase? before the erase? would it be safe to do so?


Aucun commentaire:

Enregistrer un commentaire