Reputation: 149
I am doing like this :
auto find = mp.find(key); if(find != mp.end()) mp.erase(find);
Will the above delete the whole vector as well corresponding to the key?
Upvotes: 1
Views: 127
Reputation: 16670
The call to erase
will destroy both the key and the value for the entry in the map.
So yes, it will destroy the vector as well.
Upvotes: 2