59 namespace std _GLIBCXX_VISIBILITY(default)
61 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
63 template<
typename _Tp,
typename _Alloc>
65 _List_base<_Tp, _Alloc>::
68 typedef _List_node<_Tp> _Node;
69 _Node* __cur =
static_cast<_Node*
>(_M_impl._M_node._M_next);
70 while (__cur != &_M_impl._M_node)
73 __cur =
static_cast<_Node*
>(__cur->_M_next);
74 #if __cplusplus >= 201103L
75 _M_get_Node_allocator().destroy(__tmp);
83 #if __cplusplus >= 201103L
84 template<
typename _Tp,
typename _Alloc>
85 template<
typename... _Args>
86 typename list<_Tp, _Alloc>::iterator
88 emplace(iterator __position, _Args&&... __args)
90 _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
91 __tmp->_M_hook(__position._M_node);
92 return iterator(__tmp);
96 template<
typename _Tp,
typename _Alloc>
97 typename list<_Tp, _Alloc>::iterator
101 _Node* __tmp = _M_create_node(__x);
102 __tmp->_M_hook(__position._M_node);
106 template<
typename _Tp,
typename _Alloc>
112 _M_erase(__position);
116 #if __cplusplus >= 201103L
117 template<
typename _Tp,
typename _Alloc>
125 for (; __i < __n; ++__i)
132 __throw_exception_again;
136 template<
typename _Tp,
typename _Alloc>
143 for (; __i !=
end() && __len < __new_size; ++__i, ++__len)
145 if (__len == __new_size)
148 _M_default_append(__new_size - __len);
151 template<
typename _Tp,
typename _Alloc>
154 resize(size_type __new_size,
const value_type& __x)
158 for (; __i !=
end() && __len < __new_size; ++__i, ++__len)
160 if (__len == __new_size)
163 insert(
end(), __new_size - __len, __x);
166 template<
typename _Tp,
typename _Alloc>
169 resize(size_type __new_size, value_type __x)
173 for (; __i !=
end() && __len < __new_size; ++__i, ++__len)
175 if (__len == __new_size)
178 insert(
end(), __new_size - __len, __x);
182 template<
typename _Tp,
typename _Alloc>
193 for (; __first1 != __last1 && __first2 != __last2;
194 ++__first1, ++__first2)
195 *__first1 = *__first2;
196 if (__first2 == __last2)
197 erase(__first1, __last1);
199 insert(__last1, __first2, __last2);
204 template<
typename _Tp,
typename _Alloc>
210 for (; __i !=
end() && __n > 0; ++__i, --__n)
213 insert(
end(), __n, __val);
218 template<
typename _Tp,
typename _Alloc>
219 template <
typename _InputIterator>
222 _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
225 iterator __first1 =
begin();
226 iterator __last1 =
end();
227 for (; __first1 != __last1 && __first2 != __last2;
228 ++__first1, ++__first2)
229 *__first1 = *__first2;
230 if (__first2 == __last2)
231 erase(__first1, __last1);
233 insert(__last1, __first2, __last2);
236 template<
typename _Tp,
typename _Alloc>
244 while (__first != __last)
248 if (*__first == __value)
260 if (__extra != __last)
264 template<
typename _Tp,
typename _Alloc>
271 if (__first == __last)
274 while (++__next != __last)
276 if (*__first == *__next)
284 template<
typename _Tp,
typename _Alloc>
287 #if __cplusplus >= 201103L
297 _M_check_equal_allocators(__x);
303 while (__first1 != __last1 && __first2 != __last2)
304 if (*__first2 < *__first1)
307 _M_transfer(__first1, __first2, ++__next);
312 if (__first2 != __last2)
313 _M_transfer(__last1, __first2, __last2);
317 template<
typename _Tp,
typename _Alloc>
318 template <
typename _StrictWeakOrdering>
321 #if __cplusplus >= 201103L
322 merge(
list&& __x, _StrictWeakOrdering __comp)
324 merge(
list& __x, _StrictWeakOrdering __comp)
331 _M_check_equal_allocators(__x);
337 while (__first1 != __last1 && __first2 != __last2)
338 if (__comp(*__first2, *__first1))
341 _M_transfer(__first1, __first2, ++__next);
346 if (__first2 != __last2)
347 _M_transfer(__last1, __first2, __last2);
351 template<
typename _Tp,
typename _Alloc>
357 if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
358 && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
362 list * __fill = &__tmp[0];
369 for(__counter = &__tmp[0];
370 __counter != __fill && !__counter->
empty();
373 __counter->
merge(__carry);
374 __carry.
swap(*__counter);
376 __carry.
swap(*__counter);
377 if (__counter == __fill)
382 for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
383 __counter->
merge(*(__counter - 1));
384 swap( *(__fill - 1) );
388 template<
typename _Tp,
typename _Alloc>
389 template <
typename _Predicate>
396 while (__first != __last)
400 if (__pred(*__first))
406 template<
typename _Tp,
typename _Alloc>
407 template <
typename _BinaryPredicate>
414 if (__first == __last)
417 while (++__next != __last)
419 if (__binary_pred(*__first, *__next))
427 template<
typename _Tp,
typename _Alloc>
428 template <
typename _StrictWeakOrdering>
431 sort(_StrictWeakOrdering __comp)
434 if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
435 && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
439 list * __fill = &__tmp[0];
446 for(__counter = &__tmp[0];
447 __counter != __fill && !__counter->
empty();
450 __counter->
merge(__carry, __comp);
451 __carry.
swap(*__counter);
453 __carry.
swap(*__counter);
454 if (__counter == __fill)
459 for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
460 __counter->
merge(*(__counter - 1), __comp);
465 _GLIBCXX_END_NAMESPACE_CONTAINER