64 template<
typename _Tp,
typename _Alloc>
71 typename _Node_base::_Base_ptr __cur =
_M_impl._M_node._M_next;
72 while (__cur !=
_M_impl._M_node._M_base())
74 _Node& __tmp =
static_cast<_Node&
>(*__cur);
75 __cur = __tmp._M_next;
80#if __cplusplus >= 201103L
81 template<
typename _Tp,
typename _Alloc>
82 template<
typename... _Args>
88 __tmp->_M_hook(__position._M_const_cast()._M_node);
94 template<
typename _Tp,
typename _Alloc>
97#if __cplusplus >= 201103L
109#if __cplusplus >= 201103L
110 template<
typename _Tp,
typename _Alloc>
119 splice(__position, __tmp);
122 return __position._M_const_cast();
125 template<
typename _Tp,
typename _Alloc>
126 template<
typename _InputIterator,
typename>
130 _InputIterator __last)
136 splice(__position, __tmp);
139 return __position._M_const_cast();
143 template<
typename _Tp,
typename _Alloc>
146#if __cplusplus >= 201103L
168 template<
typename _Tp,
typename _Alloc>
174#if _GLIBCXX_USE_CXX11_ABI
176 if (__new_size < __len)
178 if (__new_size <= __len / 2)
186 ptrdiff_t __num_erase = __len - __new_size;
196 for (__i =
begin(); __i !=
end() && __len < __new_size; ++__i, ++__len)
203#if __cplusplus >= 201103L
204 template<
typename _Tp,
typename _Alloc>
212 for (; __i < __n; ++__i)
223 template<
typename _Tp,
typename _Alloc>
235 template<
typename _Tp,
typename _Alloc>
247 template<
typename _Tp,
typename _Alloc>
252 const_iterator __i = _M_resize_pos(__new_size);
254 insert(
end(), __new_size, __x);
256 erase(__i._M_const_cast(),
end());
260 template<
typename _Tp,
typename _Alloc>
267#if __cplusplus >= 201103L
273 && __this_alloc != __that_alloc)
278 std::__alloc_on_copy(__this_alloc, __that_alloc);
286 template<
typename _Tp,
typename _Alloc>
292 for (; __i !=
end() && __n > 0; ++__i, --__n)
300 template<
typename _Tp,
typename _Alloc>
301 template <
typename _InputIterator>
309 for (; __first1 != __last1 && __first2 != __last2;
310 ++__first1, (void)++__first2)
311 *__first1 = *__first2;
312 if (__first2 == __last2)
313 erase(__first1, __last1);
315 insert(__last1, __first2, __last2);
318#if __cplusplus > 201703L
319# define _GLIBCXX20_ONLY(__expr) __expr
321# define _GLIBCXX20_ONLY(__expr)
324 template<
typename _Tp,
typename _Alloc>
329#if !_GLIBCXX_USE_CXX11_ABI
330 size_type __removed __attribute__((__unused__)) = 0;
335 while (__first != __last)
339 if (*__first == __value)
344 __to_destroy.
splice(__to_destroy.
begin(), *
this, __first);
345#if !_GLIBCXX_USE_CXX11_ABI
353#if !_GLIBCXX_USE_CXX11_ABI
360 template<
typename _Tp,
typename _Alloc>
367 if (__first == __last)
369#if !_GLIBCXX_USE_CXX11_ABI
370 size_type __removed __attribute__((__unused__)) = 0;
374 while (++__next != __last)
376 if (*__first == *__next)
378 __to_destroy.
splice(__to_destroy.
begin(), *
this, __next);
379#if !_GLIBCXX_USE_CXX11_ABI
388#if !_GLIBCXX_USE_CXX11_ABI
395 template<
typename _Tp,
typename _Alloc>
398#if __cplusplus >= 201103L
417 while (__first1 != __last1 && __first2 != __last2)
418 if (*__first2 < *__first1)
426 if (__first2 != __last2)
434 template<
typename _Tp,
typename _Alloc>
435 template <
typename _StrictWeakOrdering>
438#if __cplusplus >= 201103L
439 merge(
list&& __x, _StrictWeakOrdering __comp)
441 merge(
list& __x, _StrictWeakOrdering __comp)
457 while (__first1 != __last1 && __first2 != __last2)
458 if (__comp(*__first2, *__first1))
466 if (__first2 != __last2)
474 template<
typename _Tp,
typename _Alloc>
495 _Scratch_list __carry;
496 _Scratch_list __tmp[64];
497 _Scratch_list* __fill = __tmp;
498 _Scratch_list* __counter;
500 typename _Scratch_list::template _Ptr_cmp<iterator, void> __ptr_comp;
506 __carry._M_take_one(
begin()._M_node);
508 for(__counter = __tmp;
509 __counter != __fill && !__counter->empty();
513 __counter->merge(__carry, __ptr_comp);
514 __carry.swap(*__counter);
516 __carry.swap(*__counter);
517 if (__counter == __fill)
522 for (__counter = __tmp + 1; __counter != __fill; ++__counter)
523 __counter->merge(__counter[-1], __ptr_comp);
524 __fill[-1].swap(this->
_M_impl._M_node);
529 __carry._M_put_all(
end()._M_node);
530 for (
int __i = 0; __i <
sizeof(__tmp)/
sizeof(__tmp[0]); ++__i)
531 __tmp[__i]._M_put_all(
end()._M_node);
537 template<
typename _Tp,
typename _Alloc>
538 template <
typename _Predicate>
543#if !_GLIBCXX_USE_CXX11_ABI
544 size_type __removed __attribute__((__unused__)) = 0;
549 while (__first != __last)
553 if (__pred(*__first))
555 __to_destroy.
splice(__to_destroy.
begin(), *
this, __first);
556#if !_GLIBCXX_USE_CXX11_ABI
563#if !_GLIBCXX_USE_CXX11_ABI
570 template<
typename _Tp,
typename _Alloc>
571 template <
typename _BinaryPredicate>
574 unique(_BinaryPredicate __binary_pred)
578 if (__first == __last)
580#if !_GLIBCXX_USE_CXX11_ABI
581 size_type __removed __attribute__((__unused__)) = 0;
585 while (++__next != __last)
587 if (__binary_pred(*__first, *__next))
589 __to_destroy.
splice(__to_destroy.
begin(), *
this, __next);
590#if !_GLIBCXX_USE_CXX11_ABI
599#if !_GLIBCXX_USE_CXX11_ABI
606#undef _GLIBCXX20_ONLY
608 template<
typename _Tp,
typename _Alloc>
609 template <
typename _StrictWeakOrdering>
612 sort(_StrictWeakOrdering __comp)
622 _Scratch_list __carry;
623 _Scratch_list __tmp[64];
624 _Scratch_list* __fill = __tmp;
625 _Scratch_list* __counter;
627 typename _Scratch_list::
628 template _Ptr_cmp<iterator, _StrictWeakOrdering> __ptr_comp
635 __carry._M_take_one(
begin()._M_node);
637 for(__counter = __tmp;
638 __counter != __fill && !__counter->empty();
642 __counter->merge(__carry, __ptr_comp);
643 __carry.swap(*__counter);
645 __carry.swap(*__counter);
646 if (__counter == __fill)
651 for (__counter = __tmp + 1; __counter != __fill; ++__counter)
652 __counter->merge(__counter[-1], __ptr_comp);
653 __fill[-1].swap(this->
_M_impl._M_node);
658 __carry._M_put_all(
end()._M_node);
659 for (
size_t __i = 0; __i <
sizeof(__tmp)/
sizeof(__tmp[0]); ++__i)
660 __tmp[__i]._M_put_all(
end()._M_node);
#define _GLIBCXX20_ONLY(__expr)
#define __throw_exception_again
#define _GLIBCXX_VISIBILITY(V)
#define _GLIBCXX_END_NAMESPACE_VERSION
#define _GLIBCXX_END_NAMESPACE_CONTAINER
#define _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
_Tp * end(valarray< _Tp > &__va) noexcept
Return an iterator pointing to one past the last element of the valarray.
__PTRDIFF_TYPE__ ptrdiff_t
constexpr void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.
ISO C++ entities toplevel namespace is std.
iterator insert(const_iterator __position, const value_type &__x)
Inserts given value into list before specified iterator.
iterator begin() noexcept
reference emplace_back(_Args &&... __args)
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
const_iterator _M_resize_pos(size_type &__new_size) const
allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
void _M_erase(iterator __position) noexcept
void pop_back() noexcept
Removes last element.
size_type size() const noexcept
void merge(list &&__x)
Merge sorted lists.
_Node_ptr _M_create_node(_Args &&... __args)
void __remove_return_type
_Node_traits::_Iterator iterator
_Node_alloc_traits::pointer _Node_ptr
void _M_transfer(iterator __position, iterator __first, iterator __last)
_Node_alloc_type & _M_get_Node_allocator() noexcept
list()=default
Creates a list with no elements.
_Node_traits::_Const_iterator const_iterator
void _M_check_equal_allocators(const list &__x) noexcept
void _M_default_append(size_type __n)
void splice(const_iterator __position, list &&__x) noexcept
Insert contents of another list.
iterator erase(const_iterator __position) noexcept
Remove element at given position.
bool empty() const noexcept
A standard container with linear time access to elements, and fixed time insertion/deletion at any po...
constexpr _Iterator< false, _Ptr > _M_const_cast() const noexcept
__list::_Node_base< _VoidPtr > _Node_base
__list::_Node< _ValPtr > _Node
void _M_inc_size(size_t __n)
void _M_destroy_node(_Node_ptr __p)
static constexpr bool _S_always_equal()
static constexpr bool _S_propagate_on_copy_assign()