From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- libcxx/include/list | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'libcxx/include/list') diff --git a/libcxx/include/list b/libcxx/include/list index ae318ead31dab..55b45f1a67d4f 100644 --- a/libcxx/include/list +++ b/libcxx/include/list @@ -170,9 +170,11 @@ template noexcept(noexcept(x.swap(y))); template - void erase(list& c, const U& value); // C++20 + typename list::size_type + erase(list& c, const U& value); // C++20 template - void erase_if(list& c, Predicate pred); // C++20 + typename list::size_type + erase_if(list& 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 -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 -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 -- cgit v1.2.3