diff options
Diffstat (limited to 'libcxx/include/forward_list')
-rw-r--r-- | libcxx/include/forward_list | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list index 3905745931fde..3bd8db8b7d4d3 100644 --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -169,9 +169,11 @@ template <class T, class Allocator> noexcept(noexcept(x.swap(y))); template <class T, class Allocator, class U> - void erase(forward_list<T, Allocator>& c, const U& value); // C++20 + typename forward_list<T, Allocator>::size_type + erase(forward_list<T, Allocator>& c, const U& value); // C++20 template <class T, class Allocator, class Predicate> - void erase_if(forward_list<T, Allocator>& c, Predicate pred); // C++20 + typename forward_list<T, Allocator>::size_type + erase_if(forward_list<T, Allocator>& c, Predicate pred); // C++20 } // std @@ -1765,13 +1767,17 @@ swap(forward_list<_Tp, _Alloc>& __x, forward_list<_Tp, _Alloc>& __y) #if _LIBCPP_STD_VER > 17 template <class _Tp, class _Allocator, class _Predicate> inline _LIBCPP_INLINE_VISIBILITY -void erase_if(forward_list<_Tp, _Allocator>& __c, _Predicate __pred) -{ __c.remove_if(__pred); } + typename forward_list<_Tp, _Allocator>::size_type + erase_if(forward_list<_Tp, _Allocator>& __c, _Predicate __pred) { + return __c.remove_if(__pred); +} template <class _Tp, class _Allocator, class _Up> inline _LIBCPP_INLINE_VISIBILITY -void erase(forward_list<_Tp, _Allocator>& __c, const _Up& __v) -{ _VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; }); } + typename forward_list<_Tp, _Allocator>::size_type + erase(forward_list<_Tp, _Allocator>& __c, const _Up& __v) { + return _VSTD::erase_if(__c, [&](auto& __elem) { return __elem == __v; }); +} #endif _LIBCPP_END_NAMESPACE_STD |