diff options
Diffstat (limited to 'absl/container/node_hash_map.h')
-rw-r--r-- | absl/container/node_hash_map.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/absl/container/node_hash_map.h b/absl/container/node_hash_map.h index addf120f..fccea184 100644 --- a/absl/container/node_hash_map.h +++ b/absl/container/node_hash_map.h @@ -48,7 +48,7 @@ #include "absl/memory/memory.h" namespace absl { -inline namespace lts_2019_08_08 { +ABSL_NAMESPACE_BEGIN namespace container_internal { template <class Key, class Value> class NodeHashMapPolicy; @@ -352,6 +352,10 @@ class node_hash_map // Inserts (via copy or move) the element of the specified key into the // `node_hash_map` using the position of `hint` as a non-binding suggestion // for where to begin the insertion search. + // + // All `try_emplace()` overloads make the same guarantees regarding rvalue + // arguments as `std::unordered_map::try_emplace()`, namely that these + // functions will not move from rvalue arguments if insertions do not happen. using Base::try_emplace; // node_hash_map::extract() @@ -518,6 +522,15 @@ class node_hash_map void resize(typename Base::size_type hint) { this->rehash(hint); } }; +// erase_if(node_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(node_hash_map<K, V, H, E, A>& c, Predicate pred) { + container_internal::EraseIf(pred, &c); +} + namespace container_internal { template <class Key, class Value> @@ -578,7 +591,7 @@ struct IsUnorderedContainer< } // namespace container_algorithm_internal -} // inline namespace lts_2019_08_08 +ABSL_NAMESPACE_END } // namespace absl #endif // ABSL_CONTAINER_NODE_HASH_MAP_H_ |