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
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)
334#if !_GLIBCXX_USE_CXX11_ABI
340 while (__first != __last)
344 if (*__first == __value)
350#if !_GLIBCXX_USE_CXX11_ABI
358#if !_GLIBCXX_USE_CXX11_ABI
365 template<
typename _Tp,
typename _Alloc>
366 typename list<_Tp, _Alloc>::__remove_return_type
372 if (__first == __last)
373 return _GLIBCXX20_ONLY( 0 );
374#if !_GLIBCXX_USE_CXX11_ABI
379 while (++__next != __last)
381 if (*__first == *__next)
384#if !_GLIBCXX_USE_CXX11_ABI
393#if !_GLIBCXX_USE_CXX11_ABI
400 template<
typename _Tp,
typename _Alloc>
403#if __cplusplus >= 201103L
413 _M_check_equal_allocators(__x);
439 template<
typename _Tp,
typename _Alloc>
440 template <
typename _StrictWeakOrdering>
443#if __cplusplus >= 201103L
453 _M_check_equal_allocators(__x);
479 template<
typename _Tp,
typename _Alloc>
485 if (this->_M_impl._M_node._M_next != &
this->_M_impl._M_node
486 &&
this->_M_impl._M_node._M_next->_M_next != &
this->_M_impl._M_node)
513 swap( *(__fill - 1) );
517 this->splice(this->
end(), __carry);
518 for (
int __i = 0; __i <
sizeof(
__tmp)/
sizeof(
__tmp[0]); ++__i)
519 this->splice(this->
end(), __tmp[__i]);
520 __throw_exception_again;
525 template<
typename _Tp,
typename _Alloc>
526 template <
typename _Predicate>
527 typename list<_Tp, _Alloc>::__remove_return_type
531#if !_GLIBCXX_USE_CXX11_ABI
537 while (__first != __last)
544#if !_GLIBCXX_USE_CXX11_ABI
551#if !_GLIBCXX_USE_CXX11_ABI
558 template<
typename _Tp,
typename _Alloc>
559 template <
typename _BinaryPredicate>
560 typename list<_Tp, _Alloc>::__remove_return_type
566 if (__first == __last)
567 return _GLIBCXX20_ONLY(0);
568#if !_GLIBCXX_USE_CXX11_ABI
573 while (++__next != __last)
578#if !_GLIBCXX_USE_CXX11_ABI
587#if !_GLIBCXX_USE_CXX11_ABI
594#undef _GLIBCXX20_ONLY
596 template<
typename _Tp,
typename _Alloc>
597 template <
typename _StrictWeakOrdering>
603 if (this->_M_impl._M_node._M_next != &
this->_M_impl._M_node
604 &&
this->_M_impl._M_node._M_next->_M_next != &
this->_M_impl._M_node)
635 this->splice(this->
end(), __carry);
636 for (
int __i = 0; __i <
sizeof(
__tmp)/
sizeof(
__tmp[0]); ++__i)
637 this->splice(this->
end(), __tmp[__i]);
638 __throw_exception_again;
643_GLIBCXX_END_NAMESPACE_CONTAINER
644_GLIBCXX_END_NAMESPACE_VERSION
void swap(any &__x, any &__y) noexcept
Exchange the states of two any objects.
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 auto empty(const _Container &__cont) noexcept(noexcept(__cont.empty())) -> decltype(__cont.empty())
Return whether a container is empty.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
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.
__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.