about summary refs log tree commit diff
path: root/absl/container/flat_hash_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/container/flat_hash_map.h')
-rw-r--r--absl/container/flat_hash_map.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/absl/container/flat_hash_map.h b/absl/container/flat_hash_map.h
index fb570cd495ee..fcb70d861f39 100644
--- a/absl/container/flat_hash_map.h
+++ b/absl/container/flat_hash_map.h
@@ -532,6 +532,15 @@ class flat_hash_map : public absl::container_internal::raw_hash_map<
   using Base::key_eq;
 };
 
+// erase_if(flat_hash_map<>, Pred)
+//
+// Erases all elements that satisfy the predicate `pred` from the container `c`.
+template <typename K, typename V, typename H, typename E, typename A,
+          typename Predicate>
+void erase_if(flat_hash_map<K, V, H, E, A>& c, Predicate pred) {
+  container_internal::EraseIf(pred, &c);
+}
+
 namespace container_internal {
 
 template <class K, class V>