typename TContainer::iterator erase_if_impl(TContainer& cont, TPred pred, associative_tag) { auto ret = cont.end(); for (auto it = begin(cont); it != end(cont); /* */) { if (pred(*it)) { ret = cont.erase(it++); } else { ++it; } } return ret; }
typename TContainer::iterator erase_impl(TContainer& cont, const TValue& val, associative_tag) { return cont.erase(val); }
typename TContainer::iterator erase_if_impl(TContainer& cont, TPred pred, vectorlike_tag) { return cont.erase(std::remove_if(begin(cont), end(cont), pred), end(cont)); }
typename TContainer::iterator erase_impl(TContainer& cont, const TValue& val, vectorlike_tag) { return cont.erase(std::remove(begin(cont), end(cont), val), end(cont)); }