Remove all items from a collection equal to a particular element in linear time. Only really useful for Sequences.

This commit is contained in:
Steve Checkoway
2006-11-03 04:46:36 +00:00
parent 6f26ca2872
commit 24a5651f0e
+5
View File
@@ -113,6 +113,11 @@ inline void RemoveIf( Container& c, Predicate p )
{
c.erase( remove_if(c.begin(), c.end(), p), c.end() );
}
template<typename Container, typename Value>
inline void RemoveIfEqual( Container &c, const Value &v )
{
c.erase( remove(c.begin(), c.end(), v), c.end() );
}
/* Helper for ConvertValue(). */
template<typename TO, typename FROM>