29 #ifndef _GLIBCXX_FORWARD_LIST 30 #define _GLIBCXX_FORWARD_LIST 1 32 #ifdef _GLIBCXX_SYSHDR 33 #pragma GCC system_header 38 #if __cplusplus < 201103L 50 #define __glibcxx_want_algorithm_default_value_type 51 #define __glibcxx_want_allocator_traits_is_always_equal 52 #define __glibcxx_want_containers_ranges 53 #define __glibcxx_want_erase_if 54 #define __glibcxx_want_incomplete_container_elements 55 #define __glibcxx_want_list_remove_return_type 56 #define __glibcxx_want_nonmember_container_access 59 #if __cplusplus >= 201703L 61 namespace std _GLIBCXX_VISIBILITY(default)
63 _GLIBCXX_BEGIN_NAMESPACE_VERSION
66 template<
typename _Tp>
69 _GLIBCXX_END_NAMESPACE_VERSION
73 #ifdef __cpp_lib_erase_if // C++ >= 20 && HOSTED 74 namespace std _GLIBCXX_VISIBILITY(default)
76 _GLIBCXX_BEGIN_NAMESPACE_VERSION
77 template<
typename _Tp,
typename _Alloc,
typename _Predicate>
78 inline typename _GLIBCXX_STD_C::forward_list<_Tp, _Alloc>::size_type
79 erase_if(_GLIBCXX_STD_C::forward_list<_Tp, _Alloc>&
__cont, _Predicate __pred)
80 {
return __cont.remove_if(__pred); }
82 template<
typename _Tp,
typename _Alloc,
83 typename _Up _GLIBCXX26_DEF_VAL_T(_Tp)>
84 inline typename _GLIBCXX_STD_C::forward_list<_Tp, _Alloc>::size_type
85 erase(_GLIBCXX_STD_C::forward_list<_Tp, _Alloc>& __cont,
const _Up& __value)
89 return std::erase_if(__cont, [&](
const auto& __elem) ->
bool {
90 return __elem == __value;
93 _GLIBCXX_END_NAMESPACE_VERSION
95 #endif // __cpp_lib_erase_if 99 #endif // _GLIBCXX_FORWARD_LIST
ISO C++ entities toplevel namespace is std.
A standard container with linear time access to elements, and fixed time insertion/deletion at any po...