61 #if __cplusplus >= 201103L 67 namespace std _GLIBCXX_VISIBILITY(default)
71 _GLIBCXX_BEGIN_NAMESPACE_VERSION
93 _M_reverse() _GLIBCXX_USE_NOEXCEPT;
99 _M_unhook() _GLIBCXX_USE_NOEXCEPT;
102 _GLIBCXX_END_NAMESPACE_VERSION
105 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
108 template<
typename _Tp>
111 #if __cplusplus >= 201103L 112 __gnu_cxx::__aligned_membuf<_Tp> _M_storage;
113 _Tp* _M_valptr() {
return _M_storage._M_ptr(); }
114 _Tp
const* _M_valptr()
const {
return _M_storage._M_ptr(); }
127 template<
typename _Tp>
133 typedef ptrdiff_t difference_type;
135 typedef _Tp value_type;
136 typedef _Tp* pointer;
137 typedef _Tp& reference;
147 _M_const_cast()
const _GLIBCXX_NOEXCEPT
153 {
return *
static_cast<_Node*
>(_M_node)->_M_valptr(); }
156 operator->()
const _GLIBCXX_NOEXCEPT
157 {
return static_cast<_Node*
>(_M_node)->_M_valptr(); }
160 operator++() _GLIBCXX_NOEXCEPT
162 _M_node = _M_node->_M_next;
167 operator++(
int) _GLIBCXX_NOEXCEPT
170 _M_node = _M_node->_M_next;
175 operator--() _GLIBCXX_NOEXCEPT
177 _M_node = _M_node->_M_prev;
182 operator--(
int) _GLIBCXX_NOEXCEPT
185 _M_node = _M_node->_M_prev;
190 operator==(
const _Self& __x)
const _GLIBCXX_NOEXCEPT
191 {
return _M_node == __x._M_node; }
194 operator!=(
const _Self& __x)
const _GLIBCXX_NOEXCEPT
195 {
return _M_node != __x._M_node; }
206 template<
typename _Tp>
213 typedef ptrdiff_t difference_type;
215 typedef _Tp value_type;
216 typedef const _Tp* pointer;
217 typedef const _Tp& reference;
228 : _M_node(__x._M_node) { }
231 _M_const_cast()
const _GLIBCXX_NOEXCEPT
232 {
return iterator(const_cast<__detail::_List_node_base*>(_M_node)); }
237 {
return *
static_cast<_Node*
>(_M_node)->_M_valptr(); }
240 operator->()
const _GLIBCXX_NOEXCEPT
241 {
return static_cast<_Node*
>(_M_node)->_M_valptr(); }
244 operator++() _GLIBCXX_NOEXCEPT
246 _M_node = _M_node->_M_next;
251 operator++(
int) _GLIBCXX_NOEXCEPT
254 _M_node = _M_node->_M_next;
259 operator--() _GLIBCXX_NOEXCEPT
261 _M_node = _M_node->_M_prev;
266 operator--(
int) _GLIBCXX_NOEXCEPT
269 _M_node = _M_node->_M_prev;
274 operator==(
const _Self& __x)
const _GLIBCXX_NOEXCEPT
275 {
return _M_node == __x._M_node; }
278 operator!=(
const _Self& __x)
const _GLIBCXX_NOEXCEPT
279 {
return _M_node != __x._M_node; }
285 template<
typename _Val>
289 {
return __x._M_node == __y._M_node; }
291 template<
typename _Val>
295 {
return __x._M_node != __y._M_node; }
297 _GLIBCXX_BEGIN_NAMESPACE_CXX11
299 template<
typename _Tp,
typename _Alloc>
304 rebind<_Tp>::other _Tp_alloc_type;
306 typedef typename _Tp_alloc_traits::template
307 rebind<_List_node<_Tp> >::other _Node_alloc_type;
315 while (__first != __last)
317 __first = __first->_M_next;
324 :
public _Node_alloc_type
326 #if _GLIBCXX_USE_CXX11_ABI 332 _List_impl() _GLIBCXX_NOEXCEPT
333 : _Node_alloc_type(), _M_node()
336 _List_impl(
const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
337 : _Node_alloc_type(__a), _M_node()
340 #if __cplusplus >= 201103L 341 _List_impl(_Node_alloc_type&& __a) noexcept
342 : _Node_alloc_type(std::move(__a)), _M_node()
349 #if _GLIBCXX_USE_CXX11_ABI 350 size_t _M_get_size()
const {
return *_M_impl._M_node._M_valptr(); }
352 void _M_set_size(
size_t __n) { *_M_impl._M_node._M_valptr() = __n; }
354 void _M_inc_size(
size_t __n) { *_M_impl._M_node._M_valptr() += __n; }
356 void _M_dec_size(
size_t __n) { *_M_impl._M_node._M_valptr() -= __n; }
361 {
return _S_distance(__first, __last); }
364 size_t _M_node_count()
const {
return *_M_impl._M_node._M_valptr(); }
367 size_t _M_get_size()
const {
return 0; }
368 void _M_set_size(
size_t) { }
369 void _M_inc_size(
size_t) { }
370 void _M_dec_size(
size_t) { }
371 size_t _M_distance(
const void*,
const void*)
const {
return 0; }
374 size_t _M_node_count()
const 376 return _S_distance(_M_impl._M_node._M_next,
381 typename _Node_alloc_traits::pointer
383 {
return _Node_alloc_traits::allocate(_M_impl, 1); }
386 _M_put_node(
typename _Node_alloc_traits::pointer __p) _GLIBCXX_NOEXCEPT
387 { _Node_alloc_traits::deallocate(_M_impl, __p, 1); }
390 typedef _Alloc allocator_type;
393 _M_get_Node_allocator() _GLIBCXX_NOEXCEPT
396 const _Node_alloc_type&
397 _M_get_Node_allocator()
const _GLIBCXX_NOEXCEPT
404 _List_base(
const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
408 #if __cplusplus >= 201103L 410 : _M_impl(std::move(__x._M_get_Node_allocator()))
411 { _M_move_nodes(std::move(__x)); }
414 : _M_impl(std::move(__a))
416 if (__x._M_get_Node_allocator() == _M_get_Node_allocator())
417 _M_move_nodes(std::move(__x));
426 if (__xnode->_M_next == __xnode)
431 __node->_M_next = __xnode->_M_next;
432 __node->_M_prev = __xnode->_M_prev;
433 __node->_M_next->_M_prev = __node->_M_prev->_M_next = __node;
434 _M_set_size(__x._M_get_size());
445 _M_clear() _GLIBCXX_NOEXCEPT;
448 _M_init() _GLIBCXX_NOEXCEPT
450 this->_M_impl._M_node._M_next = &this->_M_impl._M_node;
451 this->_M_impl._M_node._M_prev = &this->_M_impl._M_node;
502 template<
typename _Tp,
typename _Alloc = std::allocator<_Tp> >
506 typedef typename _Alloc::value_type _Alloc_value_type;
507 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
508 __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
511 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
513 typedef typename _Base::_Node_alloc_type _Node_alloc_type;
517 typedef _Tp value_type;
518 typedef typename _Tp_alloc_traits::pointer pointer;
519 typedef typename _Tp_alloc_traits::const_pointer const_pointer;
520 typedef typename _Tp_alloc_traits::reference reference;
521 typedef typename _Tp_alloc_traits::const_reference const_reference;
526 typedef size_t size_type;
527 typedef ptrdiff_t difference_type;
528 typedef _Alloc allocator_type;
535 using _Base::_M_impl;
536 using _Base::_M_put_node;
537 using _Base::_M_get_node;
538 using _Base::_M_get_Node_allocator;
546 #if __cplusplus < 201103L 548 _M_create_node(
const value_type& __x)
550 _Node* __p = this->_M_get_node();
553 _Tp_alloc_type __alloc(_M_get_Node_allocator());
554 __alloc.construct(__p->_M_valptr(), __x);
559 __throw_exception_again;
564 template<
typename... _Args>
568 auto __p = this->_M_get_node();
569 auto& __alloc = _M_get_Node_allocator();
571 _Node_alloc_traits::construct(__alloc, __p->_M_valptr(),
572 std::forward<_Args>(__args)...);
586 #if __cplusplus >= 201103L 587 noexcept(is_nothrow_default_constructible<_Node_alloc_type>::value)
596 list(
const allocator_type& __a) _GLIBCXX_NOEXCEPT
597 : _Base(_Node_alloc_type(__a)) { }
599 #if __cplusplus >= 201103L 609 list(size_type __n,
const allocator_type& __a = allocator_type())
610 : _Base(_Node_alloc_type(__a))
611 { _M_default_initialize(__n); }
621 list(size_type __n,
const value_type& __value,
622 const allocator_type& __a = allocator_type())
623 : _Base(_Node_alloc_type(__a))
624 { _M_fill_initialize(__n, __value); }
635 list(size_type __n,
const value_type& __value = value_type(),
636 const allocator_type& __a = allocator_type())
637 : _Base(_Node_alloc_type(__a))
638 { _M_fill_initialize(__n, __value); }
649 : _Base(_Node_alloc_traits::
650 _S_select_on_copy(__x._M_get_Node_allocator()))
651 { _M_initialize_dispatch(__x.
begin(), __x.
end(), __false_type()); }
653 #if __cplusplus >= 201103L 662 : _Base(std::move(__x)) { }
673 const allocator_type& __a = allocator_type())
674 : _Base(_Node_alloc_type(__a))
675 { _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
677 list(
const list& __x,
const allocator_type& __a)
678 : _Base(_Node_alloc_type(__a))
679 { _M_initialize_dispatch(__x.
begin(), __x.
end(), __false_type()); }
681 list(list&& __x,
const allocator_type& __a)
682 noexcept(_Node_alloc_traits::_S_always_equal())
683 : _Base(std::move(__x), _Node_alloc_type(__a))
687 insert(
begin(), std::__make_move_if_noexcept_iterator(__x.
begin()),
688 std::__make_move_if_noexcept_iterator(__x.
end()));
702 #if __cplusplus >= 201103L 703 template<
typename _InputIterator,
704 typename = std::_RequireInputIter<_InputIterator>>
705 list(_InputIterator __first, _InputIterator __last,
706 const allocator_type& __a = allocator_type())
707 : _Base(_Node_alloc_type(__a))
708 { _M_initialize_dispatch(__first, __last, __false_type()); }
710 template<
typename _InputIterator>
711 list(_InputIterator __first, _InputIterator __last,
712 const allocator_type& __a = allocator_type())
713 : _Base(_Node_alloc_type(__a))
716 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
717 _M_initialize_dispatch(__first, __last, _Integral());
721 #if __cplusplus >= 201103L 741 operator=(
const list& __x);
743 #if __cplusplus >= 201103L 756 noexcept(_Node_alloc_traits::_S_nothrow_move())
758 constexpr
bool __move_storage =
759 _Node_alloc_traits::_S_propagate_on_move_assign()
760 || _Node_alloc_traits::_S_always_equal();
775 this->assign(__l.begin(), __l.end());
791 assign(size_type __n,
const value_type& __val)
792 { _M_fill_assign(__n, __val); }
806 #if __cplusplus >= 201103L 807 template<
typename _InputIterator,
808 typename = std::_RequireInputIter<_InputIterator>>
810 assign(_InputIterator __first, _InputIterator __last)
811 { _M_assign_dispatch(__first, __last, __false_type()); }
813 template<
typename _InputIterator>
815 assign(_InputIterator __first, _InputIterator __last)
818 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
819 _M_assign_dispatch(__first, __last, _Integral());
823 #if __cplusplus >= 201103L 833 { this->_M_assign_dispatch(__l.begin(), __l.end(), __false_type()); }
839 {
return allocator_type(_Base::_M_get_Node_allocator()); }
848 {
return iterator(this->_M_impl._M_node._M_next); }
857 {
return const_iterator(this->_M_impl._M_node._M_next); }
866 {
return iterator(&this->_M_impl._M_node); }
874 end() const _GLIBCXX_NOEXCEPT
875 {
return const_iterator(&this->_M_impl._M_node); }
884 {
return reverse_iterator(
end()); }
891 const_reverse_iterator
893 {
return const_reverse_iterator(
end()); }
902 {
return reverse_iterator(
begin()); }
909 const_reverse_iterator
911 {
return const_reverse_iterator(
begin()); }
913 #if __cplusplus >= 201103L 921 {
return const_iterator(this->_M_impl._M_node._M_next); }
930 {
return const_iterator(&this->_M_impl._M_node); }
937 const_reverse_iterator
939 {
return const_reverse_iterator(
end()); }
946 const_reverse_iterator
948 {
return const_reverse_iterator(
begin()); }
958 {
return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; }
963 {
return this->_M_node_count(); }
968 {
return _Node_alloc_traits::max_size(_M_get_Node_allocator()); }
970 #if __cplusplus >= 201103L 981 resize(size_type __new_size);
994 resize(size_type __new_size,
const value_type& __x);
1007 resize(size_type __new_size, value_type __x = value_type());
1017 {
return *
begin(); }
1025 {
return *
begin(); }
1034 iterator __tmp =
end();
1046 const_iterator __tmp =
end();
1064 { this->_M_insert(
begin(), __x); }
1066 #if __cplusplus >= 201103L 1068 push_front(value_type&& __x)
1069 { this->_M_insert(
begin(), std::move(__x)); }
1071 template<
typename... _Args>
1072 #if __cplusplus > 201402L 1077 emplace_front(_Args&&... __args)
1079 this->_M_insert(
begin(), std::forward<_Args>(__args)...);
1080 #if __cplusplus > 201402L 1100 { this->_M_erase(
begin()); }
1114 { this->_M_insert(
end(), __x); }
1116 #if __cplusplus >= 201103L 1118 push_back(value_type&& __x)
1119 { this->_M_insert(
end(), std::move(__x)); }
1121 template<
typename... _Args>
1122 #if __cplusplus > 201402L 1127 emplace_back(_Args&&... __args)
1129 this->_M_insert(
end(), std::forward<_Args>(__args)...);
1130 #if __cplusplus > 201402L 1149 { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
1151 #if __cplusplus >= 201103L 1164 template<
typename... _Args>
1166 emplace(const_iterator __position, _Args&&... __args);
1180 insert(const_iterator __position,
const value_type& __x);
1194 insert(iterator __position,
const value_type& __x);
1197 #if __cplusplus >= 201103L 1210 insert(const_iterator __position, value_type&& __x)
1211 {
return emplace(__position, std::move(__x)); }
1230 {
return this->insert(__p, __l.begin(), __l.end()); }
1233 #if __cplusplus >= 201103L 1249 insert(const_iterator __position, size_type __n,
const value_type& __x);
1264 insert(iterator __position, size_type __n,
const value_type& __x)
1266 list __tmp(__n, __x, get_allocator());
1267 splice(__position, __tmp);
1271 #if __cplusplus >= 201103L 1287 template<
typename _InputIterator,
1288 typename = std::_RequireInputIter<_InputIterator>>
1290 insert(const_iterator __position, _InputIterator __first,
1291 _InputIterator __last);
1306 template<
typename _InputIterator>
1308 insert(iterator __position, _InputIterator __first,
1309 _InputIterator __last)
1311 list __tmp(__first, __last, get_allocator());
1312 splice(__position, __tmp);
1332 #if __cplusplus >= 201103L 1333 erase(const_iterator __position) noexcept;
1335 erase(iterator __position);
1357 #if __cplusplus >= 201103L 1358 erase(const_iterator __first, const_iterator __last) noexcept
1360 erase(iterator __first, iterator __last)
1363 while (__first != __last)
1364 __first = erase(__first);
1365 return __last._M_const_cast();
1382 __detail::_List_node_base::swap(this->_M_impl._M_node,
1383 __x._M_impl._M_node);
1385 size_t __xsize = __x._M_get_size();
1386 __x._M_set_size(this->_M_get_size());
1387 this->_M_set_size(__xsize);
1389 _Node_alloc_traits::_S_on_swap(this->_M_get_Node_allocator(),
1390 __x._M_get_Node_allocator());
1419 #if __cplusplus >= 201103L 1420 splice(const_iterator __position, list&& __x) noexcept
1422 splice(iterator __position, list& __x)
1427 _M_check_equal_allocators(__x);
1429 this->_M_transfer(__position._M_const_cast(),
1432 this->_M_inc_size(__x._M_get_size());
1437 #if __cplusplus >= 201103L 1439 splice(const_iterator __position, list& __x) noexcept
1440 { splice(__position, std::move(__x)); }
1443 #if __cplusplus >= 201103L 1455 splice(const_iterator __position, list&& __x, const_iterator __i) noexcept
1467 splice(iterator __position, list& __x, iterator __i)
1470 iterator __j = __i._M_const_cast();
1472 if (__position == __i || __position == __j)
1476 _M_check_equal_allocators(__x);
1478 this->_M_transfer(__position._M_const_cast(),
1479 __i._M_const_cast(), __j);
1481 this->_M_inc_size(1);
1485 #if __cplusplus >= 201103L 1497 splice(const_iterator __position, list& __x, const_iterator __i) noexcept
1498 { splice(__position, std::move(__x), __i); }
1501 #if __cplusplus >= 201103L 1516 splice(const_iterator __position, list&& __x, const_iterator __first,
1517 const_iterator __last) noexcept
1532 splice(iterator __position, list& __x, iterator __first,
1536 if (__first != __last)
1539 _M_check_equal_allocators(__x);
1541 size_t __n = this->_M_distance(__first._M_node, __last._M_node);
1542 this->_M_inc_size(__n);
1543 __x._M_dec_size(__n);
1545 this->_M_transfer(__position._M_const_cast(),
1546 __first._M_const_cast(),
1547 __last._M_const_cast());
1551 #if __cplusplus >= 201103L 1566 splice(const_iterator __position, list& __x, const_iterator __first,
1567 const_iterator __last) noexcept
1568 { splice(__position, std::move(__x), __first, __last); }
1583 remove(
const _Tp& __value);
1596 template<
typename _Predicate>
1598 remove_if(_Predicate);
1625 template<
typename _BinaryPredicate>
1627 unique(_BinaryPredicate);
1638 #if __cplusplus >= 201103L 1644 { merge(std::move(__x)); }
1663 #if __cplusplus >= 201103L 1664 template<
typename _StrictWeakOrdering>
1666 merge(list&& __x, _StrictWeakOrdering __comp);
1668 template<
typename _StrictWeakOrdering>
1670 merge(list& __x, _StrictWeakOrdering __comp)
1671 { merge(std::move(__x), __comp); }
1673 template<
typename _StrictWeakOrdering>
1675 merge(list& __x, _StrictWeakOrdering __comp);
1685 { this->_M_impl._M_node._M_reverse(); }
1702 template<
typename _StrictWeakOrdering>
1704 sort(_StrictWeakOrdering);
1713 template<
typename _Integer>
1715 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
1716 { _M_fill_initialize(static_cast<size_type>(__n), __x); }
1719 template<
typename _InputIterator>
1721 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
1724 for (; __first != __last; ++__first)
1725 #
if __cplusplus >= 201103L
1726 emplace_back(*__first);
1728 push_back(*__first);
1735 _M_fill_initialize(size_type __n,
const value_type& __x)
1741 #if __cplusplus >= 201103L 1744 _M_default_initialize(size_type __n)
1752 _M_default_append(size_type __n);
1761 template<
typename _Integer>
1763 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
1764 { _M_fill_assign(__n, __val); }
1767 template<
typename _InputIterator>
1769 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
1775 _M_fill_assign(size_type __n,
const value_type& __val);
1780 _M_transfer(iterator __position, iterator __first, iterator __last)
1781 { __position._M_node->_M_transfer(__first._M_node, __last._M_node); }
1784 #if __cplusplus < 201103L 1786 _M_insert(iterator __position,
const value_type& __x)
1788 _Node* __tmp = _M_create_node(__x);
1789 __tmp->_M_hook(__position._M_node);
1790 this->_M_inc_size(1);
1793 template<
typename... _Args>
1795 _M_insert(iterator __position, _Args&&... __args)
1797 _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
1798 __tmp->_M_hook(__position._M_node);
1799 this->_M_inc_size(1);
1805 _M_erase(iterator __position) _GLIBCXX_NOEXCEPT
1807 this->_M_dec_size(1);
1808 __position._M_node->_M_unhook();
1809 _Node* __n =
static_cast<_Node*
>(__position._M_node);
1810 #if __cplusplus >= 201103L 1811 _Node_alloc_traits::destroy(_M_get_Node_allocator(), __n->_M_valptr());
1813 _Tp_alloc_type(_M_get_Node_allocator()).destroy(__n->_M_valptr());
1821 _M_check_equal_allocators(list& __x) _GLIBCXX_NOEXCEPT
1823 if (std::__alloc_neq<typename _Base::_Node_alloc_type>::
1824 _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator()))
1830 _M_resize_pos(size_type& __new_size)
const;
1832 #if __cplusplus >= 201103L 1834 _M_move_assign(list&& __x,
true_type) noexcept
1841 this->_M_impl._M_node._M_next = __x._M_impl._M_node._M_next;
1842 this->_M_impl._M_node._M_next->_M_prev = &this->_M_impl._M_node;
1843 this->_M_impl._M_node._M_prev = __x._M_impl._M_node._M_prev;
1844 this->_M_impl._M_node._M_prev->_M_next = &this->_M_impl._M_node;
1845 this->_M_set_size(__x._M_get_size());
1848 std::__alloc_on_move(this->_M_get_Node_allocator(),
1849 __x._M_get_Node_allocator());
1855 if (__x._M_get_Node_allocator() == this->_M_get_Node_allocator())
1856 _M_move_assign(std::move(__x),
true_type{});
1860 _M_assign_dispatch(std::__make_move_if_noexcept_iterator(__x.
begin()),
1861 std::__make_move_if_noexcept_iterator(__x.
end()),
1866 _GLIBCXX_END_NAMESPACE_CXX11
1878 template<
typename _Tp,
typename _Alloc>
1882 #if _GLIBCXX_USE_CXX11_ABI 1888 const_iterator __end1 = __x.
end();
1889 const_iterator __end2 = __y.
end();
1891 const_iterator __i1 = __x.
begin();
1892 const_iterator __i2 = __y.
begin();
1893 while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
1898 return __i1 == __end1 && __i2 == __end2;
1912 template<
typename _Tp,
typename _Alloc>
1916 __y.begin(), __y.end()); }
1919 template<
typename _Tp,
typename _Alloc>
1922 {
return !(__x == __y); }
1925 template<
typename _Tp,
typename _Alloc>
1928 {
return __y < __x; }
1931 template<
typename _Tp,
typename _Alloc>
1934 {
return !(__y < __x); }
1937 template<
typename _Tp,
typename _Alloc>
1940 {
return !(__x < __y); }
1943 template<
typename _Tp,
typename _Alloc>
1946 _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
1949 _GLIBCXX_END_NAMESPACE_CONTAINER
1951 #if _GLIBCXX_USE_CXX11_ABI 1952 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1955 template<
typename _Tp>
1957 __distance(_GLIBCXX_STD_C::_List_iterator<_Tp> __first,
1958 _GLIBCXX_STD_C::_List_iterator<_Tp> __last,
1961 typedef _GLIBCXX_STD_C::_List_const_iterator<_Tp> _CIter;
1962 return std::__distance(_CIter(__first), _CIter(__last), __tag);
1965 template<
typename _Tp>
1967 __distance(_GLIBCXX_STD_C::_List_const_iterator<_Tp> __first,
1968 _GLIBCXX_STD_C::_List_const_iterator<_Tp> __last,
1971 typedef _GLIBCXX_STD_C::_List_node<size_t> _Sentinel;
1972 _GLIBCXX_STD_C::_List_const_iterator<_Tp> __beyond = __last;
1974 bool __whole = __first == __beyond;
1975 if (__builtin_constant_p (__whole) && __whole)
1976 return *
static_cast<const _Sentinel*
>(__last._M_node)->_M_valptr();
1979 while (__first != __last)
1987 _GLIBCXX_END_NAMESPACE_VERSION
See bits/stl_deque.h's _Deque_base for an explanation.
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 rbegin() const noexcept
reference front() noexcept
A standard container with linear time access to elements, and fixed time insertion/deletion at any po...
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initializer_list. ...
An actual node in the list.
list(size_type __n, const allocator_type &__a=allocator_type())
Creates a list with default constructed elements.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
const_reverse_iterator crend() const noexcept
reverse_iterator rbegin() noexcept
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initializer_list.
const_reverse_iterator crbegin() const noexcept
ISO C++ entities toplevel namespace is std.
void push_front(const value_type &__x)
Add data to the front of the list.
iterator insert(const_iterator __position, value_type &&__x)
Inserts given rvalue into list before specified iterator.
iterator begin() noexcept
list(size_type __n, const value_type &__value, const allocator_type &__a=allocator_type())
Creates a list with copies of an exemplar element.
bool empty() const noexcept
const_iterator begin() const noexcept
void swap(list &__x) noexcept
Swaps data with another list.
const_iterator cbegin() const noexcept
bool lexicographical_compare(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2, _Compare __comp)
Performs dictionary comparison on ranges.
void splice(const_iterator __position, list &__x, const_iterator __first, const_iterator __last) noexcept
Insert range from another list.
list(const list &__x)
List copy constructor.
complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
void assign(initializer_list< value_type > __l)
Assigns an initializer_list to a list.
allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
size_type max_size() const noexcept
void assign(size_type __n, const value_type &__val)
Assigns a given value to a list.
void reverse() noexcept
Reverse the elements in list.
const_iterator cend() const noexcept
void splice(const_iterator __position, list &&__x) noexcept
Insert contents of another list.
const_reverse_iterator rend() const noexcept
_Node * _M_create_node(_Args &&... __args)
list(initializer_list< value_type > __l, const allocator_type &__a=allocator_type())
Builds a list from an initializer_list.
const_reference front() const noexcept
void pop_back() noexcept
Removes last element.
list & operator=(initializer_list< value_type > __l)
List initializer list assignment operator.
reverse_iterator rend() noexcept
void splice(const_iterator __position, list &__x, const_iterator __i) noexcept
Insert element from another list.
list(list &&__x) noexcept
List move constructor.
void pop_front() noexcept
Removes first element.
Non-standard RAII type for managing pointers obtained from allocators.
reference back() noexcept
list(const allocator_type &__a) noexcept
Creates a list with no elements.
Common part of a node in the list.
void splice(const_iterator __position, list &&__x, const_iterator __i) noexcept
Insert element from another list.
size_type size() const noexcept
void assign(_InputIterator __first, _InputIterator __last)
Assigns a range to a list.
const_iterator end() const noexcept
list(_InputIterator __first, _InputIterator __last, const allocator_type &__a=allocator_type())
Builds a list from a range.
list & operator=(list &&__x) noexcept(_Node_alloc_traits::_S_nothrow_move())
List move assignment operator.
Bidirectional iterators support a superset of forward iterator operations.
list() noexcept(is_nothrow_default_constructible< _Node_alloc_type >::value)
Creates a list with no elements.
void splice(const_iterator __position, list &&__x, const_iterator __first, const_iterator __last) noexcept
Insert range from another list.
const_reference back() const noexcept
Uniform interface to C++98 and C++11 allocators.
iterator erase(const_iterator __first, const_iterator __last) noexcept
Remove a range of elements.
void push_back(const value_type &__x)
Add data to the end of the list.