59namespace std _GLIBCXX_VISIBILITY(default)
61_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
63 template<
typename _Tp,
typename _Alloc>
65 _List_base<_Tp, _Alloc>::
66 _M_clear() _GLIBCXX_NOEXCEPT
68 typedef _List_node<_Tp> _Node;
69 __detail::_List_node_base* __cur = _M_impl._M_node._M_next;
70 while (__cur != &_M_impl._M_node)
72 _Node* __tmp =
static_cast<_Node*
>(__cur);
73 __cur = __tmp->_M_next;
74 _Tp* __val = __tmp->_M_valptr();
75#if __cplusplus >= 201103L
76 _Node_alloc_traits::destroy(_M_get_Node_allocator(), __val);
78 _Tp_alloc_type(_M_get_Node_allocator()).destroy(__val);
84#if __cplusplus >= 201103L
85 template<
typename _Tp,
typename _Alloc>
86 template<
typename... _Args>
87 typename list<_Tp, _Alloc>::iterator
98 template<
typename _Tp,
typename _Alloc>
101#if __cplusplus >= 201103L
109 this->_M_inc_size(1);
113#if __cplusplus >= 201103L
114 template<
typename _Tp,
typename _Alloc>
129 template<
typename _Tp,
typename _Alloc>
130 template<
typename _InputIterator,
typename>
136 list __tmp(__first, __last, get_allocator());
147 template<
typename _Tp,
typename _Alloc>
150#if __cplusplus >= 201103L
172 template<
typename _Tp,
typename _Alloc>
178#if _GLIBCXX_USE_CXX11_ABI
179 const size_type
__len = size();
190 ptrdiff_t __num_erase = __len - __new_size;
200 for (__i =
begin(); __i !=
end() && __len < __new_size; ++__i, ++__len)
207#if __cplusplus >= 201103L
208 template<
typename _Tp,
typename _Alloc>
211 _M_default_append(size_type __n)
216 for (; __i < __n; ++__i)
223 __throw_exception_again;
227 template<
typename _Tp,
typename _Alloc>
239 template<
typename _Tp,
typename _Alloc>
251 template<
typename _Tp,
typename _Alloc>
256 const_iterator __i = _M_resize_pos(
__new_size);
260 erase(__i._M_const_cast(),
end());
264 template<
typename _Tp,
typename _Alloc>
271#if __cplusplus >= 201103L
272 if (_Node_alloc_traits::_S_propagate_on_copy_assign())
276 if (!_Node_alloc_traits::_S_always_equal()
285 _M_assign_dispatch(__x.
begin(), __x.
end(), __false_type());
290 template<
typename _Tp,
typename _Alloc>
296 for (; __i !=
end() && __n > 0; ++__i, --__n)
299 insert(
end(), __n, __val);
304 template<
typename _Tp,
typename _Alloc>
305 template <
typename _InputIterator>
308 _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
311 iterator __first1 =
begin();
312 iterator __last1 =
end();
313 for (; __first1 != __last1 && __first2 != __last2;
314 ++__first1, ++__first2)
315 *__first1 = *__first2;
316 if (__first2 == __last2)
317 erase(__first1, __last1);
319 insert(__last1, __first2, __last2);
322 template<
typename _Tp,
typename _Alloc>
325 remove(
const value_type& __value)
330 while (__first != __last)
334 if (*__first == __value)
350 template<
typename _Tp,
typename _Alloc>
357 if (__first == __last)
360 while (++__next != __last)
362 if (*__first == *__next)
370 template<
typename _Tp,
typename _Alloc>
373#if __cplusplus >= 201103L
383 _M_check_equal_allocators(__x);
403 this->_M_inc_size(__x._M_get_size());
411 __throw_exception_again;
416 template<
typename _Tp,
typename _Alloc>
417 template <
typename _StrictWeakOrdering>
420#if __cplusplus >= 201103L
430 _M_check_equal_allocators(__x);
451 this->_M_inc_size(__x._M_get_size());
459 __throw_exception_again;
464 template<
typename _Tp,
typename _Alloc>
470 if (this->_M_impl._M_node._M_next != &
this->_M_impl._M_node
471 &&
this->_M_impl._M_node._M_next->_M_next != &
this->_M_impl._M_node)
497 swap( *(__fill - 1) );
501 template<
typename _Tp,
typename _Alloc>
502 template <
typename _Predicate>
509 while (__first != __last)
519 template<
typename _Tp,
typename _Alloc>
520 template <
typename _BinaryPredicate>
527 if (__first == __last)
530 while (++__next != __last)
540 template<
typename _Tp,
typename _Alloc>
541 template <
typename _StrictWeakOrdering>
547 if (this->_M_impl._M_node._M_next != &
this->_M_impl._M_node
548 &&
this->_M_impl._M_node._M_next->_M_next != &
this->_M_impl._M_node)
_Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
ISO C++ entities toplevel namespace is std.
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initializer_list.
void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initializer_list.
iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
A standard container with linear time access to elements, and fixed time insertion/deletion at any po...
void resize(size_type __new_size)
Resizes the list to the specified number of elements.
iterator insert(const_iterator __position, const value_type &__x)
Inserts given value into list before specified iterator.
void sort()
Sort the elements.
iterator begin() noexcept
iterator emplace(const_iterator __position, _Args &&... __args)
Constructs object in list before specified iterator.
void unique()
Remove consecutive duplicate elements.
list & operator=(const list &__x)
List assignment operator.
size_type size() const noexcept
void remove(const _Tp &__value)
Remove all elements equal to value.
void remove_if(_Predicate)
Remove all elements satisfying a predicate.