summaryrefslogtreecommitdiffstats
path: root/libcxx/include/unordered_map
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-12-14 18:49:35 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-12-14 18:49:35 +0000
commitf60c63c090114a6b5f0ba0a7aacd67e6c92920e7 (patch)
tree17e10b3f0bbd3a373498bbe621f9036bdd176e32 /libcxx/include/unordered_map
parentb7e2d6e4931b88fc5c84358a1fa7a9d3dffbecbc (diff)
downloadbcm5719-llvm-f60c63c090114a6b5f0ba0a7aacd67e6c92920e7.tar.gz
bcm5719-llvm-f60c63c090114a6b5f0ba0a7aacd67e6c92920e7.zip
Implement P1209 - Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20. Reviewed as https://reviews.llvm.org/D55532
llvm-svn: 349178
Diffstat (limited to 'libcxx/include/unordered_map')
-rw-r--r--libcxx/include/unordered_map20
1 files changed, 20 insertions, 0 deletions
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index 5dd923607d4..6035b05dc61 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -384,6 +384,12 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
unordered_multimap<Key, T, Hash, Pred, Alloc>& y)
noexcept(noexcept(x.swap(y)));
+template <class K, class T, class H, class P, class A, class Predicate>
+ void erase_if(unordered_set<K, T, H, P, A>& c, Predicate pred); // C++20
+
+template <class K, class T, class H, class P, class A, class Predicate>
+ void erase_if(unordered_multiset<K, T, H, P, A>& c, Predicate pred); // C++20
+
template <class Key, class T, class Hash, class Pred, class Alloc>
bool
operator==(const unordered_multimap<Key, T, Hash, Pred, Alloc>& x,
@@ -1626,6 +1632,13 @@ swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
__x.swap(__y);
}
+#if _LIBCPP_STD_VER > 17
+template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc, class _Predicate>
+inline _LIBCPP_INLINE_VISIBILITY
+void erase_if(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __c, _Predicate __pred)
+{ __libcpp_erase_if_container(__c, __pred); }
+#endif
+
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
bool
operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
@@ -2243,6 +2256,13 @@ swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
__x.swap(__y);
}
+#if _LIBCPP_STD_VER > 17
+template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc, class _Predicate>
+inline _LIBCPP_INLINE_VISIBILITY
+void erase_if(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __c, _Predicate __pred)
+{ __libcpp_erase_if_container(__c, __pred); }
+#endif
+
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
bool
operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
OpenPOWER on IntegriCloud