From 24a5651f0eb777f6cdfb0ff1ba015fbc51f1a7b5 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Fri, 3 Nov 2006 04:46:36 +0000 Subject: [PATCH] Remove all items from a collection equal to a particular element in linear time. Only really useful for Sequences. --- stepmania/src/RageUtil.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 12966a2c28..4ee2f1fdc6 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -113,6 +113,11 @@ inline void RemoveIf( Container& c, Predicate p ) { c.erase( remove_if(c.begin(), c.end(), p), c.end() ); } +template +inline void RemoveIfEqual( Container &c, const Value &v ) +{ + c.erase( remove(c.begin(), c.end(), v), c.end() ); +} /* Helper for ConvertValue(). */ template