56 #define _GLIBCXX_LIST 1 58 #ifdef _GLIBCXX_SYSHDR 59 #pragma GCC system_header 74 #define __glibcxx_want_algorithm_default_value_type 75 #define __glibcxx_want_allocator_traits_is_always_equal 76 #define __glibcxx_want_containers_ranges 77 #define __glibcxx_want_erase_if 78 #define __glibcxx_want_incomplete_container_elements 79 #define __glibcxx_want_list_remove_return_type 80 #define __glibcxx_want_nonmember_container_access 83 #if __cplusplus >= 201703L 85 namespace std _GLIBCXX_VISIBILITY(default)
87 _GLIBCXX_BEGIN_NAMESPACE_VERSION
90 template<
typename _Tp>
93 _GLIBCXX_END_NAMESPACE_VERSION
97 #ifdef __cpp_lib_erase_if // C++ >= 20 && HOSTED 98 namespace std _GLIBCXX_VISIBILITY(default)
100 _GLIBCXX_BEGIN_NAMESPACE_VERSION
101 template<
typename _Tp,
typename _Alloc,
typename _Predicate>
102 inline typename _GLIBCXX_STD_C::list<_Tp, _Alloc>::size_type
103 erase_if(_GLIBCXX_STD_C::list<_Tp, _Alloc>&
__cont, _Predicate __pred)
104 {
return __cont.remove_if(__pred); }
106 template<
typename _Tp,
typename _Alloc,
107 typename _Up _GLIBCXX26_DEF_VAL_T(_Tp)>
108 inline typename _GLIBCXX_STD_C::list<_Tp, _Alloc>::size_type
109 erase(_GLIBCXX_STD_C::list<_Tp, _Alloc>& __cont,
const _Up& __value)
113 return std::erase_if(__cont, [&](
const auto& __elem) ->
bool {
114 return __elem == __value;
117 _GLIBCXX_END_NAMESPACE_VERSION
119 #endif // __cpp_lib_erase_if
A standard container with linear time access to elements, and fixed time insertion/deletion at any po...
ISO C++ entities toplevel namespace is std.