How do you erase an element thats inside a map. Not the key but the element the key is pointing to? This doesnt seem to be doing what i want it to.
map<int, vector<int> > my_map;
map<int, vector<int> >::iterator it;
void erase(int num)
{
for(map::iterator item=my_map.begin();item != my_map.end())
{
if(it == num)
my_map.erase(it++);
else
++it;
}
}