59namespace std _GLIBCXX_VISIBILITY(default)
61_GLIBCXX_BEGIN_NAMESPACE_VERSION
62_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
64 template<
typename _Tp,
typename _Alloc>
66 _List_base<_Tp, _Alloc>::
67 _M_clear() _GLIBCXX_NOEXCEPT
69 typedef _List_node<_Tp> _Node;
70 __detail::_List_node_base* __cur = _M_impl._M_node._M_next;
71 while (__cur != &_M_impl._M_node)
73 _Node* __tmp =
static_cast<_Node*
>(__cur);
74 __cur = __tmp->_M_next;
75 _Tp* __val = __tmp->_M_valptr();
76#if __cplusplus >= 201103L
77 _Node_alloc_traits::destroy(_M_get_Node_allocator(), __val);
79 _Tp_alloc_type(_M_get_Node_allocator()).destroy(__val);
85#if __cplusplus >= 201103L
86 template<
typename _Tp,
typename _Alloc>
87 template<
typename... _Args>
88 typename list<_Tp, _Alloc>::iterator
99 template<
typename _Tp,
typename _Alloc>
102#if __cplusplus >= 201103L
110 this->_M_inc_size(1);
114#if __cplusplus >= 201103L
115 template<
typename _Tp,
typename _Alloc>
130 template<
typename _Tp,
typename _Alloc>
131 template<
typename _InputIterator,
typename>
137 list __tmp(__first, __last, get_allocator());
148 template<
typename _Tp,
typename _Alloc>
151#if __cplusplus >= 201103L
173 template<
typename _Tp,
typename _Alloc>
179#if _GLIBCXX_USE_CXX11_ABI
180 const size_type
__len = size();
191 ptrdiff_t __num_erase = __len - __new_size;
201 for (__i =
begin(); __i !=
end() && __len < __new_size; ++__i, ++__len)
208#if __cplusplus >= 201103L
209 template<
typename _Tp,
typename _Alloc>
212 _M_default_append(size_type __n)
217 for (; __i < __n; ++__i)
224 __throw_exception_again;
228 template<
typename _Tp,
typename _Alloc>
240 template<
typename _Tp,
typename _Alloc>
252 template<
typename _Tp,
typename _Alloc>
257 const_iterator __i = _M_resize_pos(
__new_size);
261 erase(__i._M_const_cast(),
end());
265 template<
typename _Tp,
typename _Alloc>
272#if __cplusplus >= 201103L
273 if (_Node_alloc_traits::_S_propagate_on_copy_assign())
277 if (!_Node_alloc_traits::_S_always_equal()
286 _M_assign_dispatch(__x.
begin(), __x.
end(), __false_type());
291 template<
typename _Tp,
typename _Alloc>
297 for (; __i !=
end() && __n > 0; ++__i, --__n)
300 insert(
end(), __n, __val);
305 template<
typename _Tp,
typename _Alloc>
306 template <
typename _InputIterator>
309 _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
312 iterator __first1 =
begin();
313 iterator __last1 =
end();
314 for (; __first1 != __last1 && __first2 != __last2;
315 ++__first1, (void)++__first2)
316 *__first1 = *__first2;
317 if (__first2 == __last2)
318 erase(__first1, __last1);
320 insert(__last1, __first2, __last2);
323#if __cplusplus > 201703L
324# define _GLIBCXX20_ONLY(__expr) __expr
326# define _GLIBCXX20_ONLY(__expr)
329 template<
typename _Tp,
typename _Alloc>
330 typename list<_Tp, _Alloc>::__remove_return_type
332 remove(
const value_type& __value)
338 while (__first != __last)
342 if (*__first == __value)
365 template<
typename _Tp,
typename _Alloc>
366 typename list<_Tp, _Alloc>::__remove_return_type
372 if (__first == __last)
373 return _GLIBCXX20_ONLY( 0 );
376 while (++__next != __last)
378 if (*__first == *__next)
390 template<
typename _Tp,
typename _Alloc>
393#if __cplusplus >= 201103L
403 _M_check_equal_allocators(__x);
409#if _GLIBCXX_USE_CXX11_ABI
425 this->_M_inc_size(__x._M_get_size());
427#if _GLIBCXX_USE_CXX11_ABI
434 __throw_exception_again;
440 template<
typename _Tp,
typename _Alloc>
441 template <
typename _StrictWeakOrdering>
444#if __cplusplus >= 201103L
454 _M_check_equal_allocators(__x);
475 this->_M_inc_size(__x._M_get_size());
483 __throw_exception_again;
488 template<
typename _Tp,
typename _Alloc>
494 if (this->_M_impl._M_node._M_next != &
this->_M_impl._M_node
495 &&
this->_M_impl._M_node._M_next->_M_next != &
this->_M_impl._M_node)
522 swap( *(__fill - 1) );
526 this->splice(this->
end(), __carry);
527 for (
int __i = 0; __i <
sizeof(
__tmp)/
sizeof(
__tmp[0]); ++__i)
528 this->splice(this->
end(), __tmp[__i]);
529 __throw_exception_again;
534 template<
typename _Tp,
typename _Alloc>
535 template <
typename _Predicate>
536 typename list<_Tp, _Alloc>::__remove_return_type
543 while (__first != __last)
557 template<
typename _Tp,
typename _Alloc>
558 template <
typename _BinaryPredicate>
559 typename list<_Tp, _Alloc>::__remove_return_type
565 if (__first == __last)
566 return _GLIBCXX20_ONLY(0);
569 while (++__next != __last)
583#undef _GLIBCXX20_ONLY
585 template<
typename _Tp,
typename _Alloc>
586 template <
typename _StrictWeakOrdering>
592 if (this->_M_impl._M_node._M_next != &
this->_M_impl._M_node
593 &&
this->_M_impl._M_node._M_next->_M_next != &
this->_M_impl._M_node)
624 this->splice(this->
end(), __carry);
625 for (
int __i = 0; __i <
sizeof(
__tmp)/
sizeof(
__tmp[0]); ++__i)
626 this->splice(this->
end(), __tmp[__i]);
627 __throw_exception_again;
632_GLIBCXX_END_NAMESPACE_CONTAINER
633_GLIBCXX_END_NAMESPACE_VERSION
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
_Tp * end(valarray< _Tp > &__va) noexcept
Return an iterator pointing to one past the last element of the valarray.
_Tp * begin(valarray< _Tp > &__va) noexcept
Return an iterator pointing to the first element of the valarray.
ISO C++ entities toplevel namespace is std.
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
constexpr void advance(_InputIterator &__i, _Distance __n)
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.
list & operator=(const list &__x)
List assignment operator.
__remove_return_type unique()
Remove consecutive duplicate elements.
size_type size() const noexcept
__remove_return_type remove(const _Tp &__value)
Remove all elements equal to value.
__remove_return_type remove_if(_Predicate)
Remove all elements satisfying a predicate.