61 #if __cplusplus >= 201103L
67 namespace std _GLIBCXX_VISIBILITY(default)
69 _GLIBCXX_BEGIN_NAMESPACE_VERSION
93 _M_reverse() _GLIBCXX_USE_NOEXCEPT;
99 _M_unhook() _GLIBCXX_USE_NOEXCEPT;
105 #if _GLIBCXX_USE_CXX11_ABI
112 #if __cplusplus >= 201103L
115 # if _GLIBCXX_USE_CXX11_ABI
116 , _M_size(__x._M_size)
119 if (__x._M_base()->_M_next == __x._M_base())
120 this->_M_next = this->_M_prev =
this;
123 this->_M_next->_M_prev = this->_M_prev->_M_next = this->_M_base();
132 if (__xnode->_M_next == __xnode)
137 __node->_M_next = __xnode->_M_next;
138 __node->_M_prev = __xnode->_M_prev;
139 __node->_M_next->_M_prev = __node->_M_prev->_M_next = __node;
140 # if _GLIBCXX_USE_CXX11_ABI
141 _M_size = __x._M_size;
149 _M_init() _GLIBCXX_NOEXCEPT
151 this->_M_next = this->_M_prev =
this;
152 #if _GLIBCXX_USE_CXX11_ABI
162 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
165 template<
typename _Tp>
168 #if __cplusplus >= 201103L
169 __gnu_cxx::__aligned_membuf<_Tp> _M_storage;
170 _Tp* _M_valptr() {
return _M_storage._M_ptr(); }
171 _Tp
const* _M_valptr()
const {
return _M_storage._M_ptr(); }
184 template<
typename _Tp>
190 typedef ptrdiff_t difference_type;
192 typedef _Tp value_type;
193 typedef _Tp* pointer;
194 typedef _Tp& reference;
204 _M_const_cast()
const _GLIBCXX_NOEXCEPT
209 operator*()
const _GLIBCXX_NOEXCEPT
210 {
return *
static_cast<_Node*
>(_M_node)->_M_valptr(); }
213 operator->()
const _GLIBCXX_NOEXCEPT
214 {
return static_cast<_Node*
>(_M_node)->_M_valptr(); }
217 operator++() _GLIBCXX_NOEXCEPT
219 _M_node = _M_node->_M_next;
224 operator++(
int) _GLIBCXX_NOEXCEPT
227 _M_node = _M_node->_M_next;
232 operator--() _GLIBCXX_NOEXCEPT
234 _M_node = _M_node->_M_prev;
239 operator--(
int) _GLIBCXX_NOEXCEPT
242 _M_node = _M_node->_M_prev;
247 operator==(
const _Self& __x,
const _Self& __y) _GLIBCXX_NOEXCEPT
248 {
return __x._M_node == __y._M_node; }
250 #if __cpp_impl_three_way_comparison < 201907L
252 operator!=(
const _Self& __x,
const _Self& __y) _GLIBCXX_NOEXCEPT
253 {
return __x._M_node != __y._M_node; }
265 template<
typename _Tp>
272 typedef ptrdiff_t difference_type;
274 typedef _Tp value_type;
275 typedef const _Tp* pointer;
276 typedef const _Tp& reference;
287 : _M_node(__x._M_node) { }
290 _M_const_cast()
const _GLIBCXX_NOEXCEPT
295 operator*()
const _GLIBCXX_NOEXCEPT
296 {
return *
static_cast<_Node*
>(_M_node)->_M_valptr(); }
299 operator->()
const _GLIBCXX_NOEXCEPT
300 {
return static_cast<_Node*
>(_M_node)->_M_valptr(); }
303 operator++() _GLIBCXX_NOEXCEPT
305 _M_node = _M_node->_M_next;
310 operator++(
int) _GLIBCXX_NOEXCEPT
313 _M_node = _M_node->_M_next;
318 operator--() _GLIBCXX_NOEXCEPT
320 _M_node = _M_node->_M_prev;
325 operator--(
int) _GLIBCXX_NOEXCEPT
328 _M_node = _M_node->_M_prev;
333 operator==(
const _Self& __x,
const _Self& __y) _GLIBCXX_NOEXCEPT
334 {
return __x._M_node == __y._M_node; }
336 #if __cpp_impl_three_way_comparison < 201907L
338 operator!=(
const _Self& __x,
const _Self& __y) _GLIBCXX_NOEXCEPT
339 {
return __x._M_node != __y._M_node; }
346 _GLIBCXX_BEGIN_NAMESPACE_CXX11
348 template<
typename _Tp,
typename _Alloc>
353 rebind<_Tp>::other _Tp_alloc_type;
355 typedef typename _Tp_alloc_traits::template
356 rebind<_List_node<_Tp> >::other _Node_alloc_type;
359 #if !_GLIBCXX_INLINE_VERSION
365 while (__first != __last)
367 __first = __first->_M_next;
375 :
public _Node_alloc_type
379 _List_impl() _GLIBCXX_NOEXCEPT_IF(
384 _List_impl(
const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
385 : _Node_alloc_type(__a)
388 #if __cplusplus >= 201103L
389 _List_impl(_List_impl&&) =
default;
391 _List_impl(_Node_alloc_type&& __a, _List_impl&& __x)
395 _List_impl(_Node_alloc_type&& __a) noexcept
403 #if _GLIBCXX_USE_CXX11_ABI
404 size_t _M_get_size()
const {
return _M_impl._M_node._M_size; }
406 void _M_set_size(
size_t __n) { _M_impl._M_node._M_size = __n; }
408 void _M_inc_size(
size_t __n) { _M_impl._M_node._M_size += __n; }
410 void _M_dec_size(
size_t __n) { _M_impl._M_node._M_size -= __n; }
412 # if !_GLIBCXX_INLINE_VERSION
416 {
return _S_distance(__first, __last); }
419 size_t _M_node_count()
const {
return _M_get_size(); }
423 size_t _M_get_size()
const {
return 0; }
424 void _M_set_size(
size_t) { }
425 void _M_inc_size(
size_t) { }
426 void _M_dec_size(
size_t) { }
428 # if !_GLIBCXX_INLINE_VERSION
429 size_t _M_distance(
const void*,
const void*)
const {
return 0; }
432 size_t _M_node_count()
const
434 return _S_distance(_M_impl._M_node._M_next,
440 typename _Node_alloc_traits::pointer
445 _M_put_node(
typename _Node_alloc_traits::pointer __p) _GLIBCXX_NOEXCEPT
449 typedef _Alloc allocator_type;
452 _M_get_Node_allocator() _GLIBCXX_NOEXCEPT
455 const _Node_alloc_type&
456 _M_get_Node_allocator()
const _GLIBCXX_NOEXCEPT
459 #if __cplusplus >= 201103L
465 _List_base(
const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
469 #if __cplusplus >= 201103L
472 # if !_GLIBCXX_INLINE_VERSION
476 if (__x._M_get_Node_allocator() == _M_get_Node_allocator())
494 { _M_impl._M_node._M_move_nodes(
std::move(__x._M_impl._M_node)); }
502 _M_clear() _GLIBCXX_NOEXCEPT;
505 _M_init() _GLIBCXX_NOEXCEPT
506 { this->_M_impl._M_node._M_init(); }
555 template<
typename _Tp,
typename _Alloc = std::allocator<_Tp> >
558 #ifdef _GLIBCXX_CONCEPT_CHECKS
560 typedef typename _Alloc::value_type _Alloc_value_type;
561 # if __cplusplus < 201103L
562 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
564 __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
567 #if __cplusplus >= 201103L
568 static_assert(
is_same<
typename remove_cv<_Tp>::type, _Tp>::value,
569 "std::list must have a non-const, non-volatile value_type");
570 # if __cplusplus > 201703L || defined __STRICT_ANSI__
572 "std::list must have the same value_type as its allocator");
577 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
579 typedef typename _Base::_Node_alloc_type _Node_alloc_type;
583 typedef _Tp value_type;
584 typedef typename _Tp_alloc_traits::pointer pointer;
585 typedef typename _Tp_alloc_traits::const_pointer const_pointer;
586 typedef typename _Tp_alloc_traits::reference reference;
587 typedef typename _Tp_alloc_traits::const_reference const_reference;
592 typedef size_t size_type;
593 typedef ptrdiff_t difference_type;
594 typedef _Alloc allocator_type;
601 using _Base::_M_impl;
602 using _Base::_M_put_node;
603 using _Base::_M_get_node;
604 using _Base::_M_get_Node_allocator;
612 #if __cplusplus < 201103L
616 _Node* __p = this->_M_get_node();
619 _Tp_alloc_type __alloc(_M_get_Node_allocator());
620 __alloc.construct(__p->_M_valptr(), __x);
625 __throw_exception_again;
630 template<
typename... _Args>
634 auto __p = this->_M_get_node();
635 auto& __alloc = _M_get_Node_allocator();
637 _Node_alloc_traits::construct(__alloc, __p->_M_valptr(),
638 std::forward<_Args>(__args)...);
644 #if _GLIBCXX_USE_CXX11_ABI
646 _S_distance(const_iterator __first, const_iterator __last)
651 _M_node_count()
const
652 {
return this->_M_get_size(); }
656 _S_distance(const_iterator, const_iterator)
661 _M_node_count()
const
672 #if __cplusplus >= 201103L
683 list(
const allocator_type& __a) _GLIBCXX_NOEXCEPT
684 :
_Base(_Node_alloc_type(__a)) { }
686 #if __cplusplus >= 201103L
696 list(size_type __n,
const allocator_type& __a = allocator_type())
697 :
_Base(_Node_alloc_type(__a))
698 { _M_default_initialize(__n); }
708 list(size_type __n,
const value_type& __value,
709 const allocator_type& __a = allocator_type())
710 :
_Base(_Node_alloc_type(__a))
711 { _M_fill_initialize(__n, __value); }
722 list(size_type __n,
const value_type& __value = value_type(),
723 const allocator_type& __a = allocator_type())
724 : _Base(_Node_alloc_type(__a))
725 { _M_fill_initialize(__n, __value); }
737 _S_select_on_copy(__x._M_get_Node_allocator()))
738 { _M_initialize_dispatch(__x.
begin(), __x.
end(), __false_type()); }
740 #if __cplusplus >= 201103L
759 const allocator_type& __a = allocator_type())
760 :
_Base(_Node_alloc_type(__a))
761 { _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
763 list(
const list& __x,
const allocator_type& __a)
764 : _Base(_Node_alloc_type(__a))
765 { _M_initialize_dispatch(__x.
begin(), __x.
end(), __false_type()); }
769 : _Base(_Node_alloc_type(__a),
std::move(__x))
773 : _Base(_Node_alloc_type(__a))
775 if (__x._M_get_Node_allocator() == this->_M_get_Node_allocator())
779 std::__make_move_if_noexcept_iterator(__x.
end()));
783 list(
list&& __x,
const allocator_type& __a)
784 noexcept(_Node_alloc_traits::_S_always_equal())
786 typename _Node_alloc_traits::is_always_equal{})
800 #if __cplusplus >= 201103L
801 template<
typename _InputIterator,
802 typename = std::_RequireInputIter<_InputIterator>>
803 list(_InputIterator __first, _InputIterator __last,
804 const allocator_type& __a = allocator_type())
805 :
_Base(_Node_alloc_type(__a))
806 { _M_initialize_dispatch(__first, __last, __false_type()); }
808 template<
typename _InputIterator>
809 list(_InputIterator __first, _InputIterator __last,
810 const allocator_type& __a = allocator_type())
811 : _Base(_Node_alloc_type(__a))
814 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
815 _M_initialize_dispatch(__first, __last, _Integral());
819 #if __cplusplus >= 201103L
841 #if __cplusplus >= 201103L
854 noexcept(_Node_alloc_traits::_S_nothrow_move())
856 constexpr
bool __move_storage =
857 _Node_alloc_traits::_S_propagate_on_move_assign()
858 || _Node_alloc_traits::_S_always_equal();
873 this->
assign(__l.begin(), __l.end());
889 assign(size_type __n,
const value_type& __val)
890 { _M_fill_assign(__n, __val); }
904 #if __cplusplus >= 201103L
905 template<
typename _InputIterator,
906 typename = std::_RequireInputIter<_InputIterator>>
908 assign(_InputIterator __first, _InputIterator __last)
909 { _M_assign_dispatch(__first, __last, __false_type()); }
911 template<
typename _InputIterator>
913 assign(_InputIterator __first, _InputIterator __last)
916 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
917 _M_assign_dispatch(__first, __last, _Integral());
921 #if __cplusplus >= 201103L
931 { this->_M_assign_dispatch(__l.begin(), __l.end(), __false_type()); }
937 {
return allocator_type(_Base::_M_get_Node_allocator()); }
946 {
return iterator(this->_M_impl._M_node._M_next); }
964 {
return iterator(&this->_M_impl._M_node); }
972 end() const _GLIBCXX_NOEXCEPT
989 const_reverse_iterator
1007 const_reverse_iterator
1011 #if __cplusplus >= 201103L
1035 const_reverse_iterator
1044 const_reverse_iterator
1054 _GLIBCXX_NODISCARD
bool
1056 {
return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; }
1061 {
return _M_node_count(); }
1068 #if __cplusplus >= 201103L
1079 resize(size_type __new_size);
1092 resize(size_type __new_size,
const value_type& __x);
1105 resize(size_type __new_size, value_type __x = value_type());
1115 {
return *
begin(); }
1123 {
return *
begin(); }
1162 { this->_M_insert(
begin(), __x); }
1164 #if __cplusplus >= 201103L
1169 template<
typename... _Args>
1170 #if __cplusplus > 201402L
1175 emplace_front(_Args&&... __args)
1177 this->_M_insert(
begin(), std::forward<_Args>(__args)...);
1178 #if __cplusplus > 201402L
1198 { this->_M_erase(
begin()); }
1212 { this->_M_insert(
end(), __x); }
1214 #if __cplusplus >= 201103L
1219 template<
typename... _Args>
1220 #if __cplusplus > 201402L
1225 emplace_back(_Args&&... __args)
1227 this->_M_insert(
end(), std::forward<_Args>(__args)...);
1228 #if __cplusplus > 201402L
1247 { this->_M_erase(
iterator(this->_M_impl._M_node._M_prev)); }
1249 #if __cplusplus >= 201103L
1262 template<
typename... _Args>
1264 emplace(const_iterator __position, _Args&&... __args);
1278 insert(const_iterator __position,
const value_type& __x);
1295 #if __cplusplus >= 201103L
1328 {
return this->
insert(__p, __l.begin(), __l.end()); }
1331 #if __cplusplus >= 201103L
1347 insert(const_iterator __position, size_type __n,
const value_type& __x);
1362 insert(
iterator __position, size_type __n,
const value_type& __x)
1365 splice(__position, __tmp);
1369 #if __cplusplus >= 201103L
1385 template<
typename _InputIterator,
1386 typename = std::_RequireInputIter<_InputIterator>>
1388 insert(const_iterator __position, _InputIterator __first,
1389 _InputIterator __last);
1404 template<
typename _InputIterator>
1406 insert(iterator __position, _InputIterator __first,
1407 _InputIterator __last)
1410 splice(__position, __tmp);
1430 #if __cplusplus >= 201103L
1431 erase(const_iterator __position) noexcept;
1433 erase(iterator __position);
1455 #if __cplusplus >= 201103L
1461 while (__first != __last)
1462 __first =
erase(__first);
1463 return __last._M_const_cast();
1480 __detail::_List_node_base::swap(this->_M_impl._M_node,
1481 __x._M_impl._M_node);
1483 size_t __xsize = __x._M_get_size();
1484 __x._M_set_size(this->_M_get_size());
1485 this->_M_set_size(__xsize);
1487 _Node_alloc_traits::_S_on_swap(this->_M_get_Node_allocator(),
1488 __x._M_get_Node_allocator());
1517 #if __cplusplus >= 201103L
1525 _M_check_equal_allocators(__x);
1527 this->_M_transfer(__position._M_const_cast(),
1530 this->_M_inc_size(__x._M_get_size());
1535 #if __cplusplus >= 201103L
1537 splice(const_iterator __position,
list& __x) noexcept
1541 #if __cplusplus >= 201103L
1568 iterator __j = __i._M_const_cast();
1570 if (__position == __i || __position == __j)
1574 _M_check_equal_allocators(__x);
1576 this->_M_transfer(__position._M_const_cast(),
1577 __i._M_const_cast(), __j);
1579 this->_M_inc_size(1);
1583 #if __cplusplus >= 201103L
1599 #if __cplusplus >= 201103L
1634 if (__first != __last)
1637 _M_check_equal_allocators(__x);
1639 size_t __n = _S_distance(__first, __last);
1640 this->_M_inc_size(__n);
1641 __x._M_dec_size(__n);
1643 this->_M_transfer(__position._M_const_cast(),
1644 __first._M_const_cast(),
1645 __last._M_const_cast());
1649 #if __cplusplus >= 201103L
1670 #if __cplusplus > 201703L
1671 # define __cpp_lib_list_remove_return_type 201806L
1672 typedef size_type __remove_return_type;
1673 # define _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG \
1674 __attribute__((__abi_tag__("__cxx20")))
1676 typedef void __remove_return_type;
1677 # define _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
1692 _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
1693 __remove_return_type
1694 remove(
const _Tp& __value);
1707 template<
typename _Predicate>
1708 __remove_return_type
1721 _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
1722 __remove_return_type
1737 template<
typename _BinaryPredicate>
1738 __remove_return_type
1739 unique(_BinaryPredicate);
1741 #undef _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
1752 #if __cplusplus >= 201103L
1777 #if __cplusplus >= 201103L
1778 template<
typename _StrictWeakOrdering>
1780 merge(
list&& __x, _StrictWeakOrdering __comp);
1782 template<
typename _StrictWeakOrdering>
1784 merge(
list& __x, _StrictWeakOrdering __comp)
1787 template<
typename _StrictWeakOrdering>
1789 merge(
list& __x, _StrictWeakOrdering __comp);
1799 { this->_M_impl._M_node._M_reverse(); }
1816 template<
typename _StrictWeakOrdering>
1818 sort(_StrictWeakOrdering);
1827 template<
typename _Integer>
1829 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
1830 { _M_fill_initialize(
static_cast<size_type
>(__n), __x); }
1833 template<
typename _InputIterator>
1835 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
1838 for (; __first != __last; ++__first)
1839 #
if __cplusplus >= 201103L
1840 emplace_back(*__first);
1849 _M_fill_initialize(size_type __n,
const value_type& __x)
1855 #if __cplusplus >= 201103L
1858 _M_default_initialize(size_type __n)
1866 _M_default_append(size_type __n);
1875 template<
typename _Integer>
1877 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
1878 { _M_fill_assign(__n, __val); }
1881 template<
typename _InputIterator>
1883 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
1889 _M_fill_assign(size_type __n,
const value_type& __val);
1894 _M_transfer(iterator __position, iterator __first, iterator __last)
1895 { __position._M_node->_M_transfer(__first._M_node, __last._M_node); }
1898 #if __cplusplus < 201103L
1900 _M_insert(iterator __position,
const value_type& __x)
1903 __tmp->_M_hook(__position._M_node);
1904 this->_M_inc_size(1);
1907 template<
typename... _Args>
1909 _M_insert(iterator __position, _Args&&... __args)
1912 __tmp->_M_hook(__position._M_node);
1913 this->_M_inc_size(1);
1919 _M_erase(iterator __position) _GLIBCXX_NOEXCEPT
1921 this->_M_dec_size(1);
1922 __position._M_node->_M_unhook();
1923 _Node* __n =
static_cast<_Node*
>(__position._M_node);
1924 #if __cplusplus >= 201103L
1925 _Node_alloc_traits::destroy(_M_get_Node_allocator(), __n->_M_valptr());
1927 _Tp_alloc_type(_M_get_Node_allocator()).destroy(__n->_M_valptr());
1935 _M_check_equal_allocators(
list& __x) _GLIBCXX_NOEXCEPT
1937 if (std::__alloc_neq<typename _Base::_Node_alloc_type>::
1938 _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator()))
1944 _M_resize_pos(size_type& __new_size)
const;
1946 #if __cplusplus >= 201103L
1952 std::__alloc_on_move(this->_M_get_Node_allocator(),
1953 __x._M_get_Node_allocator());
1959 if (__x._M_get_Node_allocator() == this->_M_get_Node_allocator())
1964 _M_assign_dispatch(std::make_move_iterator(__x.begin()),
1965 std::make_move_iterator(__x.end()),
1971 #if __cpp_deduction_guides >= 201606
1972 template<
typename _InputIterator,
typename _ValT
1973 =
typename iterator_traits<_InputIterator>::value_type,
1974 typename _Allocator = allocator<_ValT>,
1975 typename = _RequireInputIter<_InputIterator>,
1976 typename = _RequireAllocator<_Allocator>>
1977 list(_InputIterator, _InputIterator, _Allocator = _Allocator())
1978 -> list<_ValT, _Allocator>;
1981 _GLIBCXX_END_NAMESPACE_CXX11
1993 template<
typename _Tp,
typename _Alloc>
1997 #if _GLIBCXX_USE_CXX11_ABI
2003 const_iterator __end1 = __x.
end();
2004 const_iterator __end2 = __y.
end();
2006 const_iterator __i1 = __x.
begin();
2007 const_iterator __i2 = __y.
begin();
2008 while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
2013 return __i1 == __end1 && __i2 == __end2;
2016 #if __cpp_lib_three_way_comparison
2028 template<
typename _Tp,
typename _Alloc>
2029 inline __detail::__synth3way_t<_Tp>
2030 operator<=>(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2032 return std::lexicographical_compare_three_way(__x.begin(), __x.end(),
2033 __y.begin(), __y.end(),
2034 __detail::__synth3way);
2048 template<
typename _Tp,
typename _Alloc>
2051 {
return std::lexicographical_compare(__x.
begin(), __x.
end(),
2055 template<
typename _Tp,
typename _Alloc>
2058 {
return !(__x == __y); }
2061 template<
typename _Tp,
typename _Alloc>
2064 {
return __y < __x; }
2067 template<
typename _Tp,
typename _Alloc>
2070 {
return !(__y < __x); }
2073 template<
typename _Tp,
typename _Alloc>
2076 {
return !(__x < __y); }
2080 template<
typename _Tp,
typename _Alloc>
2083 _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
2086 _GLIBCXX_END_NAMESPACE_CONTAINER
2088 #if _GLIBCXX_USE_CXX11_ABI
2091 template<
typename _Tp>
2093 __distance(_GLIBCXX_STD_C::_List_iterator<_Tp> __first,
2094 _GLIBCXX_STD_C::_List_iterator<_Tp> __last,
2095 input_iterator_tag __tag)
2097 typedef _GLIBCXX_STD_C::_List_const_iterator<_Tp> _CIter;
2098 return std::__distance(_CIter(__first), _CIter(__last), __tag);
2101 template<
typename _Tp>
2103 __distance(_GLIBCXX_STD_C::_List_const_iterator<_Tp> __first,
2104 _GLIBCXX_STD_C::_List_const_iterator<_Tp> __last,
2107 typedef __detail::_List_node_header _Sentinel;
2108 _GLIBCXX_STD_C::_List_const_iterator<_Tp> __beyond = __last;
2110 const bool __whole = __first == __beyond;
2111 if (__builtin_constant_p (__whole) && __whole)
2112 return static_cast<const _Sentinel*
>(__last._M_node)->_M_size;
2115 while (__first != __last)
2124 _GLIBCXX_END_NAMESPACE_VERSION
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
is_nothrow_default_constructible
Non-standard RAII type for managing pointers obtained from allocators.
Bidirectional iterators support a superset of forward iterator operations.
Common part of a node in the list.
An actual node in the list.
See bits/stl_deque.h's _Deque_base for an explanation.
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 splice(const_iterator __position, list &&__x, const_iterator __i) noexcept
Insert element from another list.
list(list &&)=default
List move constructor.
void sort()
Sort the elements.
void push_back(const value_type &__x)
Add data to the end of the list.
iterator begin() noexcept
iterator emplace(const_iterator __position, _Args &&... __args)
Constructs object in list before specified iterator.
iterator insert(const_iterator __position, value_type &&__x)
Inserts given rvalue into list before specified iterator.
allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
list & operator=(const list &__x)
List assignment operator.
void assign(initializer_list< value_type > __l)
Assigns an initializer_list to a list.
const_iterator end() const noexcept
const_reverse_iterator rbegin() const noexcept
list(size_type __n, const allocator_type &__a=allocator_type())
Creates a list with default constructed elements.
reverse_iterator rend() noexcept
void pop_back() noexcept
Removes last element.
void push_front(const value_type &__x)
Add data to the front of the list.
__remove_return_type unique()
Remove consecutive duplicate elements.
size_type size() const noexcept
void merge(list &&__x)
Merge sorted lists.
const_reference front() const noexcept
void splice(const_iterator __position, list &__x, const_iterator __first, const_iterator __last) noexcept
Insert range from another list.
void assign(_InputIterator __first, _InputIterator __last)
Assigns a range to a list.
const_iterator cend() const noexcept
_Node * _M_create_node(_Args &&... __args)
list & operator=(initializer_list< value_type > __l)
List initializer list assignment operator.
list(const allocator_type &__a) noexcept
Creates a list with no elements.
void reverse() noexcept
Reverse the elements in list.
__remove_return_type remove(const _Tp &__value)
Remove all elements equal to value.
reverse_iterator rbegin() noexcept
list()=default
Creates a list with no elements.
list & operator=(list &&__x) noexcept(_Node_alloc_traits::_S_nothrow_move())
List move assignment operator.
iterator erase(const_iterator __first, const_iterator __last) noexcept
Remove a range of elements.
reference back() noexcept
void assign(size_type __n, const value_type &__val)
Assigns a given value to a list.
void splice(const_iterator __position, list &&__x, const_iterator __first, const_iterator __last) noexcept
Insert range from another list.
void splice(const_iterator __position, list &__x, const_iterator __i) noexcept
Insert element from another list.
const_iterator cbegin() const noexcept
const_reverse_iterator crbegin() const noexcept
__remove_return_type remove_if(_Predicate)
Remove all elements satisfying a predicate.
list(initializer_list< value_type > __l, const allocator_type &__a=allocator_type())
Builds a list from an initializer_list.
size_type max_size() const noexcept
const_reference back() const noexcept
list(size_type __n, const value_type &__value, const allocator_type &__a=allocator_type())
Creates a list with copies of an exemplar element.
const_iterator begin() const noexcept
reference front() noexcept
void pop_front() noexcept
Removes first element.
list(_InputIterator __first, _InputIterator __last, const allocator_type &__a=allocator_type())
Builds a list from a range.
void splice(const_iterator __position, list &&__x) noexcept
Insert contents of another list.
list(const list &__x)
List copy constructor.
iterator erase(const_iterator __position) noexcept
Remove element at given position.
const_reverse_iterator rend() const noexcept
bool empty() const noexcept
iterator insert(const_iterator __p, initializer_list< value_type > __l)
Inserts the contents of an initializer_list into list before specified const_iterator.
const_reverse_iterator crend() const noexcept
void swap(list &__x) noexcept
Swaps data with another list.
Uniform interface to C++98 and C++11 allocators.
static constexpr pointer allocate(_Alloc &__a, size_type __n)
Allocate memory.
static constexpr void deallocate(_Alloc &__a, pointer __p, size_type __n)
Deallocate memory.
static constexpr size_type max_size(const _Alloc &__a) noexcept
The maximum supported allocation size.