I have a map of maps and during the iteration i need to delete the iterator like i show in the follow code. What is the best way to do this?
for (Map1_t::iterator itOutMap = map1.begin(); itOutMap != map1.end(); ++ itOutMap)
{
for (Map2_t::iterator itInMap = itOutMap->second.begin(); itInMap != itOutMap->second.end(); ++itInMap)
{
if (itInMap->first == USER_REQ_TYPE)
{
// need to delete the current itInMap
}
}
}