mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +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:
@@ -339,6 +339,13 @@ template <class Value, class Hash, class Pred, class Alloc>
|
||||
unordered_multiset<Value, 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 Value, class Hash, class Pred, class Alloc>
|
||||
bool
|
||||
operator==(const unordered_multiset<Value, Hash, Pred, Alloc>& x,
|
||||
@@ -934,6 +941,13 @@ swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
#if _LIBCPP_STD_VER > 17
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void erase_if(unordered_set<_Value, _Hash, _Pred, _Alloc>& __c, _Predicate __pred)
|
||||
{ __libcpp_erase_if_container(__c, __pred); }
|
||||
#endif
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
bool
|
||||
operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
@@ -1497,6 +1511,13 @@ swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
#if _LIBCPP_STD_VER > 17
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc, class _Predicate>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void erase_if(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __c, _Predicate __pred)
|
||||
{ __libcpp_erase_if_container(__c, __pred); }
|
||||
#endif
|
||||
|
||||
template <class _Value, class _Hash, class _Pred, class _Alloc>
|
||||
bool
|
||||
operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
|
||||
|
Reference in New Issue
Block a user