mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
Implement P1209 - Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20. Reviewed as https://reviews.llvm.org/D55532
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@349178 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user