Index: base/stl_util.h |
diff --git a/base/stl_util.h b/base/stl_util.h |
index e937d2f3ed9157d433cc62fb71958bd9c71cd6d9..c95af82aaf635e6dcaa8b90e833c2b0022c135c1 100644 |
--- a/base/stl_util.h |
+++ b/base/stl_util.h |
@@ -211,6 +211,11 @@ bool ContainsValue(const Collection& collection, const Value& value) { |
collection.end(); |
} |
+template <typename Collection, typename Value> |
+bool RemoveValue(Collection& collection, const Value& value) { |
+ collection.erase(std::remove(collection.begin(), collection.end(), value), collection.end()); |
+} |
+ |
namespace base { |
// Returns true if the container is sorted. |