summaryrefslogtreecommitdiff
path: root/libcxx/include/list
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/list')
-rw-r--r--libcxx/include/list20
1 files changed, 12 insertions, 8 deletions
diff --git a/libcxx/include/list b/libcxx/include/list
index ae318ead31da..55b45f1a67d4 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -170,9 +170,11 @@ template <class T, class Alloc>
noexcept(noexcept(x.swap(y)));
template <class T, class Allocator, class U>
- void erase(list<T, Allocator>& c, const U& value); // C++20
+ typename list<T, Allocator>::size_type
+ erase(list<T, Allocator>& c, const U& value); // C++20
template <class T, class Allocator, class Predicate>
- void erase_if(list<T, Allocator>& c, Predicate pred); // C++20
+ typename list<T, Allocator>::size_type
+ erase_if(list<T, Allocator>& c, Predicate pred); // C++20
} // std
@@ -2471,14 +2473,16 @@ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
#if _LIBCPP_STD_VER > 17
template <class _Tp, class _Allocator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
-void erase_if(list<_Tp, _Allocator>& __c, _Predicate __pred)
-{ __c.remove_if(__pred); }
+inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type
+erase_if(list<_Tp, _Allocator>& __c, _Predicate __pred) {
+ return __c.remove_if(__pred);
+}
template <class _Tp, class _Allocator, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY
-void erase(list<_Tp, _Allocator>& __c, const _Up& __v)
-{ _VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; }); }
+inline _LIBCPP_INLINE_VISIBILITY typename list<_Tp, _Allocator>::size_type
+erase(list<_Tp, _Allocator>& __c, const _Up& __v) {
+ return _VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; });
+}
#endif
_LIBCPP_END_NAMESPACE_STD