60 namespace std _GLIBCXX_VISIBILITY(default)
62 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
64 template<
typename _Tp,
typename _Alloc>
66 _List_base<_Tp, _Alloc>::
69 typedef _List_node<_Tp> _Node;
70 _Node* __cur =
static_cast<_Node*
>(_M_impl._M_node._M_next);
71 while (__cur != &_M_impl._M_node)
74 __cur =
static_cast<_Node*
>(__cur->_M_next);
75 #ifdef __GXX_EXPERIMENTAL_CXX0X__
76 _M_get_Node_allocator().destroy(__tmp);
84 #ifdef __GXX_EXPERIMENTAL_CXX0X__
85 template<
typename _Tp,
typename _Alloc>
86 template<
typename... _Args>
87 typename list<_Tp, _Alloc>::iterator
91 _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
92 __tmp->_M_hook(__position._M_node);
97 template<
typename _Tp,
typename _Alloc>
102 _Node* __tmp = _M_create_node(__x);
103 __tmp->_M_hook(__position._M_node);
107 template<
typename _Tp,
typename _Alloc>
113 _M_erase(__position);
117 #ifdef __GXX_EXPERIMENTAL_CXX0X__
118 template<
typename _Tp,
typename _Alloc>
126 for (; __i < __n; ++__i)
133 __throw_exception_again;
137 template<
typename _Tp,
typename _Alloc>
142 if (__new_size >
size())
143 _M_default_append(__new_size -
size());
144 else if (__new_size <
size())
152 template<
typename _Tp,
typename _Alloc>
155 resize(size_type __new_size,
const value_type& __x)
157 if (__new_size >
size())
158 insert(
end(), __new_size -
size(), __x);
159 else if (__new_size <
size())
167 template<
typename _Tp,
typename _Alloc>
170 resize(size_type __new_size, value_type __x)
174 for (; __i !=
end() && __len < __new_size; ++__i, ++__len)
176 if (__len == __new_size)
179 insert(
end(), __new_size - __len, __x);
183 template<
typename _Tp,
typename _Alloc>
194 for (; __first1 != __last1 && __first2 != __last2;
195 ++__first1, ++__first2)
196 *__first1 = *__first2;
197 if (__first2 == __last2)
198 erase(__first1, __last1);
200 insert(__last1, __first2, __last2);
205 template<
typename _Tp,
typename _Alloc>
211 for (; __i !=
end() && __n > 0; ++__i, --__n)
214 insert(
end(), __n, __val);
219 template<
typename _Tp,
typename _Alloc>
220 template <
typename _InputIterator>
223 _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
226 iterator __first1 =
begin();
227 iterator __last1 =
end();
228 for (; __first1 != __last1 && __first2 != __last2;
229 ++__first1, ++__first2)
230 *__first1 = *__first2;
231 if (__first2 == __last2)
232 erase(__first1, __last1);
234 insert(__last1, __first2, __last2);
237 template<
typename _Tp,
typename _Alloc>
245 while (__first != __last)
249 if (*__first == __value)
261 if (__extra != __last)
265 template<
typename _Tp,
typename _Alloc>
272 if (__first == __last)
275 while (++__next != __last)
277 if (*__first == *__next)
285 template<
typename _Tp,
typename _Alloc>
288 #ifdef __GXX_EXPERIMENTAL_CXX0X__
298 _M_check_equal_allocators(__x);
304 while (__first1 != __last1 && __first2 != __last2)
305 if (*__first2 < *__first1)
308 _M_transfer(__first1, __first2, ++__next);
313 if (__first2 != __last2)
314 _M_transfer(__last1, __first2, __last2);
316 #ifdef __GXX_EXPERIMENTAL_CXX0X__
317 this->_M_impl._M_size += __x.
size();
318 __x._M_impl._M_size = 0;
323 template<
typename _Tp,
typename _Alloc>
324 template <
typename _StrictWeakOrdering>
327 #ifdef __GXX_EXPERIMENTAL_CXX0X__
328 merge(
list&& __x, _StrictWeakOrdering __comp)
330 merge(
list& __x, _StrictWeakOrdering __comp)
337 _M_check_equal_allocators(__x);
343 while (__first1 != __last1 && __first2 != __last2)
344 if (__comp(*__first2, *__first1))
347 _M_transfer(__first1, __first2, ++__next);
352 if (__first2 != __last2)
353 _M_transfer(__last1, __first2, __last2);
355 #ifdef __GXX_EXPERIMENTAL_CXX0X__
356 this->_M_impl._M_size += __x.
size();
357 __x._M_impl._M_size = 0;
362 template<
typename _Tp,
typename _Alloc>
368 if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
369 && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
373 list * __fill = &__tmp[0];
380 for(__counter = &__tmp[0];
381 __counter != __fill && !__counter->
empty();
384 __counter->
merge(__carry);
385 __carry.
swap(*__counter);
387 __carry.
swap(*__counter);
388 if (__counter == __fill)
393 for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
394 __counter->
merge(*(__counter - 1));
395 swap( *(__fill - 1) );
399 template<
typename _Tp,
typename _Alloc>
400 template <
typename _Predicate>
407 while (__first != __last)
411 if (__pred(*__first))
417 template<
typename _Tp,
typename _Alloc>
418 template <
typename _BinaryPredicate>
425 if (__first == __last)
428 while (++__next != __last)
430 if (__binary_pred(*__first, *__next))
438 template<
typename _Tp,
typename _Alloc>
439 template <
typename _StrictWeakOrdering>
442 sort(_StrictWeakOrdering __comp)
445 if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
446 && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
450 list * __fill = &__tmp[0];
457 for(__counter = &__tmp[0];
458 __counter != __fill && !__counter->
empty();
461 __counter->
merge(__carry, __comp);
462 __carry.
swap(*__counter);
464 __carry.
swap(*__counter);
465 if (__counter == __fill)
470 for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
471 __counter->
merge(*(__counter - 1), __comp);
476 _GLIBCXX_END_NAMESPACE_CONTAINER