I have boost::unordered_map<int, Animal*>
and I need to delete all inserts where value is the same pointer like Animal* a;
( a is given Animal* like parameter, I have for different keys in map same Animal* pointer on couple places).
boost::unordered_map<int, Animal*> mp;
Animal* rex = new Animal("Rex");
mp[1]=rex;
mp[2]=rex;
mp[9]=rex;
How to delete all records where value is rex, and after that delete rex from heap only once ?