Original Post
I want to remove associations from a multimap under a given condition. What I would like my code to look like is as follows:
typedef std::multimap<std::pair<int,int>,BaseResolver*> resolvers_t;
resolvers_t resolvers;
void RemoveResolver(BaseResolver* theResolver) {
std::remove_if(
resolvers.begin(),
resolvers.end(),
std::compose1(
std::bind_2nd(std::equal_to<BaseResolver*>(), theResolver),
std::select2nd<resolvers_t::value_type>()));
}
Of course, the above does not work (simply because that's not what remove_if really does). Does the SC++L provide me with something like this, or do I have to manually traverse the multi_map and erase the individual iterators?