55 #ifndef _GLIBCXX_VECTOR
56 #define _GLIBCXX_VECTOR 1
58 #pragma GCC system_header
69 #ifndef _GLIBCXX_EXPORT_TEMPLATE
77 #if __cplusplus >= 201703L
78 namespace std _GLIBCXX_VISIBILITY(default)
80 _GLIBCXX_BEGIN_NAMESPACE_VERSION
82 template<
typename _Tp>
class polymorphic_allocator;
83 template<
typename _Tp>
86 # ifdef _GLIBCXX_DEBUG
87 namespace _GLIBCXX_STD_C::pmr {
88 template<
typename _Tp>
90 = _GLIBCXX_STD_C::vector<_Tp, std::pmr::polymorphic_allocator<_Tp>>;
93 _GLIBCXX_END_NAMESPACE_VERSION
97 #if __cplusplus > 201703L
98 namespace std _GLIBCXX_VISIBILITY(default)
100 _GLIBCXX_BEGIN_NAMESPACE_VERSION
102 #define __cpp_lib_erase_if 202002L
104 template<
typename _Tp,
typename _Alloc,
typename _Predicate>
106 inline typename vector<_Tp, _Alloc>::size_type
107 erase_if(vector<_Tp, _Alloc>& __cont, _Predicate __pred)
109 using namespace __gnu_cxx;
110 _GLIBCXX_STD_C::vector<_Tp, _Alloc>& __ucont = __cont;
111 const auto __osz = __cont.size();
112 const auto __end = __ucont.end();
113 auto __removed = std::__remove_if(__ucont.begin(), __end,
114 __ops::__pred_iter(std::ref(__pred)));
115 if (__removed != __end)
117 __cont.erase(__niter_wrap(__cont.begin(), __removed),
119 return __osz - __cont.size();
125 template<
typename _Tp,
typename _Alloc,
typename _Up>
127 inline typename vector<_Tp, _Alloc>::size_type
128 erase(vector<_Tp, _Alloc>& __cont,
const _Up& __value)
130 using namespace __gnu_cxx;
131 _GLIBCXX_STD_C::vector<_Tp, _Alloc>& __ucont = __cont;
132 const auto __osz = __cont.size();
133 const auto __end = __ucont.end();
134 auto __removed = std::__remove_if(__ucont.begin(), __end,
135 __ops::__iter_equals_val(__value));
136 if (__removed != __end)
138 __cont.erase(__niter_wrap(__cont.begin(), __removed),
140 return __osz - __cont.size();
145 _GLIBCXX_END_NAMESPACE_VERSION
A standard container which offers fixed time access to individual elements in any order...