63#if __cplusplus >= 201103L
69#if __glibcxx_ranges_to_container
74#if __cplusplus < 201103L
75# undef _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
76# define _GLIBCXX_USE_ALLOC_PTR_FOR_LIST 0
77#elif ! defined _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
78# define _GLIBCXX_USE_ALLOC_PTR_FOR_LIST 1
81namespace std _GLIBCXX_VISIBILITY(default)
83_GLIBCXX_BEGIN_NAMESPACE_VERSION
109 _M_reverse() _GLIBCXX_USE_NOEXCEPT;
115 _M_unhook() _GLIBCXX_USE_NOEXCEPT;
123#if _GLIBCXX_USE_CXX11_ABI
135#if __cplusplus >= 201103L
139 if (__x._M_base()->_M_next == __x._M_base())
140 this->_M_next = this->_M_prev =
this;
143 this->_M_next->_M_prev = this->_M_prev->_M_next = this->_M_base();
152 if (__xnode->_M_next == __xnode)
157 __node->_M_next = __xnode->_M_next;
158 __node->_M_prev = __xnode->_M_prev;
159 __node->_M_next->_M_prev = __node->_M_prev->_M_next = __node;
160 _List_size::operator=(__x);
167 _M_init() _GLIBCXX_NOEXCEPT
169 this->_M_next = this->_M_prev =
this;
170 _List_size::operator=(_List_size());
173 using _List_node_base::_M_base;
174#if ! _GLIBCXX_INLINE_VERSION
181#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
182_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
183_GLIBCXX_BEGIN_NAMESPACE_CXX11
184 template<
typename _Tp,
typename _Allocator>
class list;
185_GLIBCXX_END_NAMESPACE_CXX11
186_GLIBCXX_END_NAMESPACE_CONTAINER
191 template<
typename _Vo
idPtr>
199 swap(_Node_base& __x, _Node_base& __y)
noexcept;
202 _M_transfer(_Base_ptr
const __first, _Base_ptr
const __last);
205 _M_hook(_Base_ptr
const __position)
noexcept
208 this->_M_next = __position;
209 this->_M_prev = __position->_M_prev;
210 __position->_M_prev->_M_next = __self;
211 __position->_M_prev = __self;
217 auto const __next_node = this->_M_next;
218 auto const __prev_node = this->_M_prev;
219 __prev_node->_M_next = __next_node;
220 __next_node->_M_prev = __prev_node;
228 _M_base() const noexcept
230 return pointer_traits<_Base_ptr>::
231 pointer_to(
const_cast<_Node_base&
>(*
this));
235 using ::std::__detail::_List_size;
240 template<
typename _Vo
idPtr>
242 :
public _Node_base<_VoidPtr>, _List_size
244 _Node_header() noexcept
247 _Node_header(_Node_header&& __x) noexcept
248 : _Node_base<_VoidPtr>(__x), _List_size(__x)
250 if (__x._M_base()->_M_next == __x._M_base())
251 this->_M_next = this->_M_prev = this->_M_base();
254 this->_M_next->_M_prev = this->_M_prev->_M_next = this->_M_base();
260 _M_move_nodes(_Node_header&& __x)
noexcept
262 auto const __xnode = __x._M_base();
263 if (__xnode->_M_next == __xnode)
267 auto const __node = this->_M_base();
268 __node->_M_next = __xnode->_M_next;
269 __node->_M_prev = __xnode->_M_prev;
270 __node->_M_next->_M_prev = __node->_M_prev->_M_next = __node;
271 _List_size::operator=(__x);
279 this->_M_next = this->_M_prev = this->_M_base();
280 _List_size::operator=(_List_size());
283 void _M_reverse() noexcept;
287 template<typename _ValPtr>
288 struct _Node : public __list::_Node_base<
__ptr_rebind<_ValPtr,
void>>
290 using value_type =
typename pointer_traits<_ValPtr>::element_type;
291 using _Node_ptr = __ptr_rebind<_ValPtr, _Node>;
299 _Node(_Node&&) =
delete;
306 {
return pointer_traits<_Node_ptr>::pointer_to(*
this); }
309 template<
bool _Const,
typename _Ptr>
class _Iterator;
311 template<
bool _Const,
typename _Ptr>
314 using _Node = __list::_Node<_Ptr>;
316 =
typename __list::_Node_base<__ptr_rebind<_Ptr, void>>::_Base_ptr;
318 template<
typename _Tp>
319 using __maybe_const = __conditional_t<_Const, const _Tp, _Tp>;
322 using value_type =
typename pointer_traits<_Ptr>::element_type;
323 using difference_type = ptrdiff_t;
324 using iterator_category = bidirectional_iterator_tag;
325 using pointer = __maybe_const<value_type>*;
326 using reference = __maybe_const<value_type>&;
328 constexpr _Iterator() noexcept : _M_node() { }
330 _Iterator(
const _Iterator&) =
default;
331 _Iterator& operator=(
const _Iterator&) =
default;
333#ifdef __glibcxx_concepts
335 _Iterator(
const _Iterator<false, _Ptr>& __i)
requires _Const
337 template<
bool _OtherConst,
338 typename = __enable_if_t<_Const && !_OtherConst>>
340 _Iterator(
const _Iterator<_OtherConst, _Ptr>& __i)
342 : _M_node(__i._M_node) { }
345 _Iterator(_Base_ptr __x) noexcept
352 {
return static_cast<_Node&
>(*_M_node)._M_data; }
356 operator->() const noexcept
359 _GLIBCXX14_CONSTEXPR _Iterator&
360 operator++() noexcept
362 _M_node = _M_node->_M_next;
366 _GLIBCXX14_CONSTEXPR _Iterator
367 operator++(
int)
noexcept
370 _M_node = _M_node->_M_next;
374 _GLIBCXX14_CONSTEXPR _Iterator&
375 operator--() noexcept
377 _M_node = _M_node->_M_prev;
381 _GLIBCXX14_CONSTEXPR _Iterator
382 operator--(
int)
noexcept
385 _M_node = _M_node->_M_prev;
390 friend constexpr bool
391 operator==(
const _Iterator& __x,
const _Iterator& __y)
noexcept
392 {
return __x._M_node == __y._M_node; }
394#if __cpp_impl_three_way_comparison < 201907L
396 friend constexpr bool
397 operator!=(
const _Iterator& __x,
const _Iterator& __y)
noexcept
398 {
return __x._M_node != __y._M_node; }
402 template<
typename _Tp,
typename _Allocator>
403 friend class _GLIBCXX_STD_C::list;
405 friend _Iterator<!_Const, _Ptr>;
407 constexpr _Iterator<false, _Ptr>
408 _M_const_cast() const noexcept
409 {
return _Iterator<false, _Ptr>(_M_node); }
416_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
417 template<
typename _Tp>
struct _List_node;
418 template<
typename _Tp>
struct _List_iterator;
419 template<
typename _Tp>
struct _List_const_iterator;
420_GLIBCXX_END_NAMESPACE_CONTAINER
425 template<
typename _Tp,
typename _Ptr>
428#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST <= 9000
432 template<
typename _Tp>
433 struct _Node_traits<_Tp, _Tp*>
435 typedef __detail::_List_node_base _Node_base;
436 typedef __detail::_List_node_header _Node_header;
437 typedef _GLIBCXX_STD_C::_List_node<_Tp> _Node;
438 typedef _GLIBCXX_STD_C::_List_iterator<_Tp> _Iterator;
439 typedef _GLIBCXX_STD_C::_List_const_iterator<_Tp> _Const_iterator;
443#if ! _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
445 template<
typename _Tp,
typename _Ptr>
447 : _Node_traits<_Tp, _Tp*>
451 template<
typename _Tp,
typename _Ptr>
455 using _VoidPtr = __ptr_rebind<_Ptr, void>;
456 using _ValPtr = __ptr_rebind<_Ptr, _Tp>;
459 using _Node_base = __list::_Node_base<_VoidPtr>;
460 using _Node_header = __list::_Node_header<_VoidPtr>;
461 using _Node = __list::_Node<_ValPtr>;
462 using _Iterator = __list::_Iterator<false, _ValPtr>;
463 using _Const_iterator = __list::_Iterator<true, _ValPtr>;
468 template<
typename _NodeBaseT>
472 typedef _NodeBaseT _Base;
473 typedef typename _Base::_Base_ptr _Base_ptr;
475 _Scratch_list() { this->_M_next = this->_M_prev = this->_M_base(); }
477 bool empty()
const {
return this->_M_next == this->_M_base(); }
479 void swap(_Base& __l) { _Base::swap(*
this, __l); }
481 template<
typename _Iter,
typename _Cmp>
487 operator()(_Base_ptr __lhs, _Base_ptr __rhs)
488 {
return _M_cmp(*_Iter(__lhs), *_Iter(__rhs)); }
491 template<
typename _Iter>
492 struct _Ptr_cmp<_Iter, void>
495 operator()(_Base_ptr __lhs, _Base_ptr __rhs)
const
496 {
return *_Iter(__lhs) < *_Iter(__rhs); }
500 template<
typename _Cmp>
502 merge(_Base& __x, _Cmp __comp)
504 _Base_ptr __first1 = this->_M_next;
505 _Base_ptr
const __last1 = this->_M_base();
506 _Base_ptr __first2 = __x._M_next;
507 _Base_ptr
const __last2 = __x._M_base();
509 while (__first1 != __last1 && __first2 != __last2)
511 if (__comp(__first2, __first1))
513 _Base_ptr __next = __first2->_M_next;
514 __first1->_M_transfer(__first2, __next);
518 __first1 = __first1->_M_next;
520 if (__first2 != __last2)
521 this->_M_transfer(__first2, __last2);
525 void _M_take_one(_Base_ptr __i)
526 { this->_M_transfer(__i, __i->_M_next); }
529 void _M_put_all(_Base_ptr __i)
532 __i->_M_transfer(this->_M_next, this->_M_base());
537_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
540 template<
typename _Tp>
545#if __cplusplus >= 201103L
546 __gnu_cxx::__aligned_membuf<_Tp> _M_storage;
547 _Tp* _M_valptr() {
return _M_storage._M_ptr(); }
548 _Tp
const* _M_valptr()
const {
return _M_storage._M_ptr(); }
563 template<
typename _Tp>
568 typedef ptrdiff_t difference_type;
570 typedef _Tp value_type;
571 typedef _Tp* pointer;
572 typedef _Tp& reference;
582 _M_const_cast()
const _GLIBCXX_NOEXCEPT
589 {
return *
static_cast<_Node*
>(_M_node)->_M_valptr(); }
593 operator->()
const _GLIBCXX_NOEXCEPT
594 {
return static_cast<_Node*
>(_M_node)->_M_valptr(); }
597 operator++() _GLIBCXX_NOEXCEPT
599 _M_node = _M_node->_M_next;
604 operator++(
int) _GLIBCXX_NOEXCEPT
607 _M_node = _M_node->_M_next;
612 operator--() _GLIBCXX_NOEXCEPT
614 _M_node = _M_node->_M_prev;
619 operator--(
int) _GLIBCXX_NOEXCEPT
622 _M_node = _M_node->_M_prev;
630 {
return __x._M_node == __y._M_node; }
632#if __cpp_impl_three_way_comparison < 201907L
637 {
return __x._M_node != __y._M_node; }
649 template<
typename _Tp>
655 typedef ptrdiff_t difference_type;
657 typedef _Tp value_type;
658 typedef const _Tp* pointer;
659 typedef const _Tp& reference;
670 : _M_node(__x._M_node) { }
673 _M_const_cast()
const _GLIBCXX_NOEXCEPT
680 {
return *
static_cast<_Node*
>(_M_node)->_M_valptr(); }
684 operator->()
const _GLIBCXX_NOEXCEPT
685 {
return static_cast<_Node*
>(_M_node)->_M_valptr(); }
688 operator++() _GLIBCXX_NOEXCEPT
690 _M_node = _M_node->_M_next;
695 operator++(
int) _GLIBCXX_NOEXCEPT
698 _M_node = _M_node->_M_next;
703 operator--() _GLIBCXX_NOEXCEPT
705 _M_node = _M_node->_M_prev;
710 operator--(
int) _GLIBCXX_NOEXCEPT
713 _M_node = _M_node->_M_prev;
721 {
return __x._M_node == __y._M_node; }
723#if __cpp_impl_three_way_comparison < 201907L
728 {
return __x._M_node != __y._M_node; }
735_GLIBCXX_BEGIN_NAMESPACE_CXX11
737 template<
typename _Tp,
typename _Alloc>
742 rebind<_Tp>::other _Tp_alloc_type;
745 typedef __list::_Node_traits<_Tp, typename _Tp_alloc_traits::pointer>
747 typedef typename _Tp_alloc_traits::template
748 rebind<typename _Node_traits::_Node>::other _Node_alloc_type;
752 :
public _Node_alloc_type
754 typename _Node_traits::_Node_header _M_node;
756 _List_impl() _GLIBCXX_NOEXCEPT_IF(
761 _List_impl(
const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
762 : _Node_alloc_type(__a)
765#if __cplusplus >= 201103L
766 _List_impl(_List_impl&&) =
default;
768 _List_impl(_Node_alloc_type&& __a, _List_impl&& __x)
772 _List_impl(_Node_alloc_type&& __a) noexcept
780#if _GLIBCXX_USE_CXX11_ABI
781 size_t _M_get_size()
const {
return _M_impl._M_node._M_size; }
783 void _M_set_size(
size_t __n) { _M_impl._M_node._M_size = __n; }
785 void _M_inc_size(
size_t __n) { _M_impl._M_node._M_size += __n; }
787 void _M_dec_size(
size_t __n) { _M_impl._M_node._M_size -= __n; }
790 size_t _M_get_size()
const {
return 0; }
791 void _M_set_size(
size_t) { }
792 void _M_inc_size(
size_t) { }
793 void _M_dec_size(
size_t) { }
796 typename _Node_alloc_traits::pointer
798 {
return _Node_alloc_traits::allocate(_M_impl, 1); }
800#if __cplusplus < 201103L || _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
802 _M_put_node(
typename _Node_alloc_traits::pointer __p) _GLIBCXX_NOEXCEPT
803 { _Node_alloc_traits::deallocate(_M_impl, __p, 1); }
811 using __alloc_pointer =
typename _Node_alloc_traits::pointer;
813 _Node_alloc_traits::deallocate(_M_impl, __ap, 1);
817#pragma GCC diagnostic push
818#pragma GCC diagnostic ignored "-Wc++17-extensions"
820 _M_destroy_node(
typename _Node_alloc_traits::pointer __p)
822#if __cplusplus >= 201103L
824 _Node_alloc_traits::destroy(_M_impl, __p->_M_valptr());
826 using _Node =
typename _Node_traits::_Node;
827 using _Base_ptr =
typename _Node_traits::_Node_base::_Base_ptr;
831 _Tp_alloc_type(_M_impl).destroy(__p->_M_valptr());
833 this->_M_put_node(__p);
835#pragma GCC diagnostic pop
838 typedef _Alloc allocator_type;
841 _M_get_Node_allocator() _GLIBCXX_NOEXCEPT
844 const _Node_alloc_type&
845 _M_get_Node_allocator()
const _GLIBCXX_NOEXCEPT
848#if __cplusplus >= 201103L
854 _List_base(
const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
858#if __cplusplus >= 201103L
873 { _M_impl._M_node._M_move_nodes(
std::move(__x._M_impl._M_node)); }
881 _M_clear() _GLIBCXX_NOEXCEPT;
884 _M_init() _GLIBCXX_NOEXCEPT
885 { this->_M_impl._M_node._M_init(); }
887#if !_GLIBCXX_INLINE_VERSION
900#pragma GCC diagnostic push
901#pragma GCC diagnostic ignored "-Wc++17-extensions"
903# if __cplusplus >= 201103L
907#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
910 if (__x._M_get_Node_allocator() == _M_get_Node_allocator())
920#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
927 while (__first != __last)
929 __first = __first->_M_next;
936#if _GLIBCXX_USE_CXX11_ABI
940 {
return _S_distance(__first, __last); }
943 size_t _M_node_count()
const {
return _M_get_size(); }
945 size_t _M_distance(
const void*,
const void*)
const {
return 0; }
948 size_t _M_node_count()
const
950 return _S_distance(_M_impl._M_node._M_next, _M_impl._M_node._M_base());
953#pragma GCC diagnostic pop
1003 template<
typename _Tp,
typename _Alloc = std::allocator<_Tp> >
1006#ifdef _GLIBCXX_CONCEPT_CHECKS
1008 typedef typename _Alloc::value_type _Alloc_value_type;
1009# if __cplusplus < 201103L
1010 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
1012 __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
1015#if __cplusplus >= 201103L
1017 "std::list must have a non-const, non-volatile value_type");
1018# if __cplusplus > 201703L || defined __STRICT_ANSI__
1020 "std::list must have the same value_type as its allocator");
1025 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
1027 typedef typename _Base::_Node_alloc_type _Node_alloc_type;
1029 typedef typename _Base::_Node_traits _Node_traits;
1032 typedef _Tp value_type;
1033 typedef typename _Tp_alloc_traits::pointer pointer;
1034 typedef typename _Tp_alloc_traits::const_pointer const_pointer;
1035 typedef typename _Tp_alloc_traits::reference reference;
1036 typedef typename _Tp_alloc_traits::const_reference const_reference;
1037 typedef typename _Node_traits::_Iterator iterator;
1038 typedef typename _Node_traits::_Const_iterator const_iterator;
1041 typedef size_t size_type;
1042 typedef ptrdiff_t difference_type;
1043 typedef _Alloc allocator_type;
1048 typedef typename _Node_alloc_traits::pointer _Node_ptr;
1050 using _Base::_M_impl;
1051 using _Base::_M_put_node;
1052 using _Base::_M_get_node;
1053 using _Base::_M_get_Node_allocator;
1061#if __cplusplus < 201103L
1063 _M_create_node(
const value_type& __x)
1065 _Node_ptr __p = this->_M_get_node();
1068 _Tp_alloc_type __alloc(_M_get_Node_allocator());
1069 __alloc.construct(__p->_M_valptr(), __x);
1074 __throw_exception_again;
1079 template<
typename... _Args>
1083 auto& __alloc = _M_get_Node_allocator();
1084 auto __guard = std::__allocate_guarded_obj(__alloc);
1085 _Node_alloc_traits::construct(__alloc, __guard->_M_valptr(),
1086 std::forward<_Args>(__args)...);
1087 auto __p = __guard.release();
1088#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
1091 return std::__to_address(__p);
1103#if __cplusplus >= 201103L
1114 list(
const allocator_type& __a) _GLIBCXX_NOEXCEPT
1115 :
_Base(_Node_alloc_type(__a)) { }
1117#if __cplusplus >= 201103L
1127 list(size_type __n,
const allocator_type& __a = allocator_type())
1128 :
_Base(_Node_alloc_type(__a))
1129 { _M_default_initialize(__n); }
1139 list(size_type __n,
const value_type& __value,
1140 const allocator_type& __a = allocator_type())
1141 :
_Base(_Node_alloc_type(__a))
1142 { _M_fill_initialize(__n, __value); }
1153 list(size_type __n,
const value_type& __value = value_type(),
1154 const allocator_type& __a = allocator_type())
1155 : _Base(_Node_alloc_type(__a))
1156 { _M_fill_initialize(__n, __value); }
1168 _S_select_on_copy(__x._M_get_Node_allocator()))
1169 { _M_initialize_dispatch(__x.
begin(), __x.
end(), __false_type()); }
1171#if __cplusplus >= 201103L
1190 const allocator_type& __a = allocator_type())
1191 :
_Base(_Node_alloc_type(__a))
1192 { _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
1194 list(
const list& __x,
const __type_identity_t<allocator_type>& __a)
1195 : _Base(_Node_alloc_type(__a))
1196 { _M_initialize_dispatch(__x.
begin(), __x.
end(), __false_type()); }
1199 list(list&& __x,
const allocator_type& __a, true_type) noexcept
1200 : _Base(_Node_alloc_type(__a),
std::move(__x))
1203 list(list&& __x,
const allocator_type& __a, false_type)
1204 : _Base(_Node_alloc_type(__a))
1206 if (__x._M_get_Node_allocator() == this->_M_get_Node_allocator())
1209 insert(
begin(), std::__make_move_if_noexcept_iterator(__x.
begin()),
1210 std::__make_move_if_noexcept_iterator(__x.
end()));
1214 list(list&& __x,
const __type_identity_t<allocator_type>& __a)
1215 noexcept(_Node_alloc_traits::_S_always_equal())
1217 typename _Node_alloc_traits::is_always_equal{})
1231#if __cplusplus >= 201103L
1232 template<
typename _InputIterator,
1233 typename = std::_RequireInputIter<_InputIterator>>
1234 list(_InputIterator __first, _InputIterator __last,
1235 const allocator_type& __a = allocator_type())
1236 :
_Base(_Node_alloc_type(__a))
1237 { _M_initialize_dispatch(__first, __last, __false_type()); }
1239 template<
typename _InputIterator>
1240 list(_InputIterator __first, _InputIterator __last,
1241 const allocator_type& __a = allocator_type())
1242 : _Base(_Node_alloc_type(__a))
1245 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1246 _M_initialize_dispatch(__first, __last, _Integral());
1250#if __glibcxx_ranges_to_container
1255 template<__detail::__container_compatible_range<_Tp> _Rg>
1256 list(from_range_t, _Rg&& __rg,
const _Alloc& __a = _Alloc())
1257 : _Base(_Node_alloc_type(__a))
1259 auto __first = ranges::begin(__rg);
1260 const auto __last = ranges::end(__rg);
1261 for (; __first != __last; ++__first)
1262 emplace_back(*__first);
1266#if __cplusplus >= 201103L
1286 operator=(
const list& __x);
1288#if __cplusplus >= 201103L
1289#pragma GCC diagnostic push
1290#pragma GCC diagnostic ignored "-Wc++17-extensions"
1303 noexcept(_Node_alloc_traits::_S_nothrow_move())
1305 constexpr bool __move_storage =
1306 _Node_alloc_traits::_S_propagate_on_move_assign()
1307 || _Node_alloc_traits::_S_always_equal();
1308 if constexpr (!__move_storage)
1310 if (__x._M_get_Node_allocator() != this->_M_get_Node_allocator())
1314 _M_assign_dispatch(std::make_move_iterator(__x.
begin()),
1315 std::make_move_iterator(__x.
end()),
1324 if constexpr (_Node_alloc_traits::_S_propagate_on_move_assign())
1325 this->_M_get_Node_allocator()
1326 =
std::move(__x._M_get_Node_allocator());
1330#pragma GCC diagnostic pop
1342 this->assign(__l.begin(), __l.end());
1347#if __glibcxx_ranges_to_container
1352 template<__detail::__container_compatible_range<_Tp> _Rg>
1354 assign_range(_Rg&& __rg)
1356 static_assert(assignable_from<_Tp&, ranges::range_reference_t<_Rg>>);
1360 auto __first2 = ranges::begin(__rg);
1361 const auto __last2 = ranges::end(__rg);
1362 for (; __first1 != __last1 && __first2 != __last2;
1363 ++__first1, (void)++__first2)
1364 *__first1 = *__first2;
1365 if (__first2 == __last2)
1366 erase(__first1, __last1);
1368 insert_range(__last1,
1384 assign(size_type __n,
const value_type& __val)
1385 { _M_fill_assign(__n, __val); }
1399#if __cplusplus >= 201103L
1400 template<
typename _InputIterator,
1401 typename = std::_RequireInputIter<_InputIterator>>
1403 assign(_InputIterator __first, _InputIterator __last)
1404 { _M_assign_dispatch(__first, __last, __false_type()); }
1406 template<
typename _InputIterator>
1408 assign(_InputIterator __first, _InputIterator __last)
1411 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1412 _M_assign_dispatch(__first, __last, _Integral());
1416#if __cplusplus >= 201103L
1426 { this->_M_assign_dispatch(__l.begin(), __l.end(), __false_type()); }
1432 {
return allocator_type(_Base::_M_get_Node_allocator()); }
1442 {
return iterator(this->_M_impl._M_node._M_next); }
1452 {
return const_iterator(this->_M_impl._M_node._M_next); }
1462 {
return iterator(this->_M_impl._M_node._M_base()); }
1472 {
return const_iterator(this->_M_impl._M_node._M_base()); }
1490 const_reverse_iterator
1510 const_reverse_iterator
1514#if __cplusplus >= 201103L
1523 {
return const_iterator(this->_M_impl._M_node._M_next); }
1533 {
return const_iterator(this->_M_impl._M_node._M_base()); }
1541 const_reverse_iterator
1551 const_reverse_iterator
1561 _GLIBCXX_NODISCARD
bool
1564 return this->_M_impl._M_node._M_next == this->_M_impl._M_node._M_base();
1572#if _GLIBCXX_USE_CXX11_ABI
1573 return this->_M_get_size();
1583 {
return _Node_alloc_traits::max_size(_M_get_Node_allocator()); }
1585#if __cplusplus >= 201103L
1596 resize(size_type __new_size);
1609 resize(size_type __new_size,
const value_type& __x);
1622 resize(size_type __new_size, value_type __x = value_type());
1634 __glibcxx_requires_nonempty();
1646 __glibcxx_requires_nonempty();
1658 __glibcxx_requires_nonempty();
1659 iterator __tmp =
end();
1672 __glibcxx_requires_nonempty();
1673 const_iterator __tmp =
end();
1691 { this->_M_insert(
begin(), __x); }
1693#if __cplusplus >= 201103L
1695 push_front(value_type&& __x)
1698 template<
typename... _Args>
1699#if __cplusplus > 201402L
1704 emplace_front(_Args&&... __args)
1706 this->_M_insert(begin(), std::forward<_Args>(__args)...);
1707#if __cplusplus > 201402L
1713#if __glibcxx_ranges_to_container
1726 template<__detail::__container_compatible_range<_Tp> _Rg>
1728 prepend_range(_Rg&& __rg)
1730 list __tmp(from_range, std::forward<_Rg>(__rg), get_allocator());
1732 splice(
begin(), __tmp);
1747 template<__detail::__container_compatible_range<_Tp> _Rg>
1749 append_range(_Rg&& __rg)
1751 list __tmp(from_range, std::forward<_Rg>(__rg), get_allocator());
1753 splice(
end(), __tmp);
1771 { this->_M_erase(
begin()); }
1785 { this->_M_insert(
end(), __x); }
1787#if __cplusplus >= 201103L
1789 push_back(value_type&& __x)
1792 template<
typename... _Args>
1793#if __cplusplus > 201402L
1798 emplace_back(_Args&&... __args)
1800 this->_M_insert(end(), std::forward<_Args>(__args)...);
1801#if __cplusplus > 201402L
1820 { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
1822#if __cplusplus >= 201103L
1835 template<
typename... _Args>
1837 emplace(const_iterator __position, _Args&&... __args);
1853#if __cplusplus >= 201103L
1855 insert(const_iterator __position,
const value_type& __x);
1858 insert(const_iterator __position, value_type&& __x)
1859 {
return emplace(__position,
std::move(__x)); }
1862 insert(
iterator __position,
const value_type& __x);
1866#if __cplusplus >= 201103L
1884 {
return this->insert(__p, __l.begin(), __l.end()); }
1901#if __cplusplus >= 201103L
1903 insert(const_iterator __position, size_type __n,
const value_type& __x);
1906 insert(
iterator __position, size_type __n,
const value_type& __x)
1908 list __tmp(__n, __x, get_allocator());
1909 splice(__position, __tmp);
1928#if __cplusplus >= 201103L
1929 template<
typename _InputIterator,
1930 typename = std::_RequireInputIter<_InputIterator>>
1932 insert(const_iterator __position, _InputIterator __first,
1933 _InputIterator __last);
1935 template<
typename _InputIterator>
1937 insert(iterator __position, _InputIterator __first,
1938 _InputIterator __last)
1940 list __tmp(__first, __last, get_allocator());
1941 splice(__position, __tmp);
1945#if __glibcxx_ranges_to_container
1961 template<__detail::__container_compatible_range<_Tp> _Rg>
1963 insert_range(const_iterator __position, _Rg&& __rg)
1965 list __tmp(from_range, std::forward<_Rg>(__rg), get_allocator());
1968 auto __it = __tmp.begin();
1969 splice(__position, __tmp);
1972 return __position._M_const_cast();
1992#if __cplusplus >= 201103L
1993 erase(const_iterator __position)
noexcept;
1995 erase(iterator __position);
2017#if __cplusplus >= 201103L
2018 erase(const_iterator __first, const_iterator __last)
noexcept
2020 erase(iterator __first, iterator __last)
2023 while (__first != __last)
2024 __first = erase(__first);
2025 return __last._M_const_cast();
2042 _Node_traits::_Node_base::swap(this->_M_impl._M_node,
2043 __x._M_impl._M_node);
2045 size_t __xsize = __x._M_get_size();
2046 __x._M_set_size(this->_M_get_size());
2047 this->_M_set_size(__xsize);
2049 _Node_alloc_traits::_S_on_swap(this->_M_get_Node_allocator(),
2050 __x._M_get_Node_allocator());
2079#if __cplusplus >= 201103L
2082 splice(iterator __position,
list& __x)
2087 _M_check_equal_allocators(__x);
2089 this->_M_transfer(__position._M_const_cast(),
2092 this->_M_inc_size(__x._M_get_size());
2097#if __cplusplus >= 201103L
2099 splice(const_iterator __position,
list& __x)
noexcept
2114#if __cplusplus >= 201103L
2116 splice(const_iterator __position,
list&& __x, const_iterator __i)
noexcept
2119 splice(iterator __position,
list& __x, iterator __i)
2122 iterator __j = __i._M_const_cast();
2124 if (__position == __i || __position == __j)
2128 _M_check_equal_allocators(__x);
2130 this->_M_transfer(__position._M_const_cast(),
2131 __i._M_const_cast(), __j);
2133 this->_M_inc_size(1);
2137#if __cplusplus >= 201103L
2139 splice(const_iterator __position,
list& __x, const_iterator __i)
noexcept
2140 { splice(__position,
std::move(__x), __i); }
2156#if __cplusplus >= 201103L
2158 splice(const_iterator __position,
list&& __x, const_iterator __first,
2159 const_iterator __last)
noexcept
2162 splice(iterator __position,
list& __x, iterator __first,
2166 if (__first != __last)
2169 _M_check_equal_allocators(__x);
2171#if _GLIBCXX_USE_CXX11_ABI
2173 this->_M_inc_size(__n);
2174 __x._M_dec_size(__n);
2177 this->_M_transfer(__position._M_const_cast(),
2178 __first._M_const_cast(),
2179 __last._M_const_cast());
2183#if __cplusplus >= 201103L
2198 splice(const_iterator __position,
list& __x, const_iterator __first,
2199 const_iterator __last)
noexcept
2200 { splice(__position,
std::move(__x), __first, __last); }
2204#ifdef __glibcxx_list_remove_return_type
2205 typedef size_type __remove_return_type;
2206# define _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG \
2207 __attribute__((__abi_tag__("__cxx20")))
2209 typedef void __remove_return_type;
2210# define _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
2225 _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
2226 __remove_return_type
2227 remove(
const _Tp& __value);
2240 template<
typename _Predicate>
2241 __remove_return_type
2242 remove_if(_Predicate);
2254 _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
2255 __remove_return_type
2270 template<
typename _BinaryPredicate>
2271 __remove_return_type
2272 unique(_BinaryPredicate);
2274#undef _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
2285#if __cplusplus >= 201103L
2310#if __cplusplus >= 201103L
2311 template<
typename _StrictWeakOrdering>
2313 merge(list&& __x, _StrictWeakOrdering __comp);
2315 template<
typename _StrictWeakOrdering>
2317 merge(list& __x, _StrictWeakOrdering __comp)
2320 template<
typename _StrictWeakOrdering>
2322 merge(list& __x, _StrictWeakOrdering __comp);
2332 { this->_M_impl._M_node._M_reverse(); }
2349 template<
typename _StrictWeakOrdering>
2351 sort(_StrictWeakOrdering);
2360 template<
typename _Integer>
2362 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
2363 { _M_fill_initialize(
static_cast<size_type
>(__n), __x); }
2366 template<
typename _InputIterator>
2368 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
2371 for (; __first != __last; ++__first)
2372#
if __cplusplus >= 201103L
2373 emplace_back(*__first);
2375 push_back(*__first);
2382 _M_fill_initialize(size_type __n,
const value_type& __x)
2388#if __cplusplus >= 201103L
2391 _M_default_initialize(size_type __n)
2399 _M_default_append(size_type __n);
2408 template<
typename _Integer>
2410 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
2411 { _M_fill_assign(__n, __val); }
2414 template<
typename _InputIterator>
2416 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
2422 _M_fill_assign(size_type __n,
const value_type& __val);
2427 _M_transfer(iterator __position, iterator __first, iterator __last)
2428 { __position._M_node->_M_transfer(__first._M_node, __last._M_node); }
2431#if __cplusplus < 201103L
2433 _M_insert(iterator __position,
const value_type& __x)
2435 _Node_ptr __tmp = _M_create_node(__x);
2436 __tmp->_M_hook(__position._M_node);
2437 this->_M_inc_size(1);
2440 template<
typename... _Args>
2442 _M_insert(iterator __position, _Args&&... __args)
2444 _Node_ptr __tmp = _M_create_node(std::forward<_Args>(__args)...);
2445 __tmp->_M_hook(__position._M_node);
2446 this->_M_inc_size(1);
2452 _M_erase(iterator __position) _GLIBCXX_NOEXCEPT
2454 typedef typename _Node_traits::_Node _Node;
2455 this->_M_dec_size(1);
2456 __position._M_node->_M_unhook();
2457 _Node& __n =
static_cast<_Node&
>(*__position._M_node);
2458 this->_M_destroy_node(__n._M_node_ptr());
2463 _M_check_equal_allocators(
const list& __x) _GLIBCXX_NOEXCEPT
2465 if (_M_get_Node_allocator() != __x._M_get_Node_allocator())
2471 _M_resize_pos(size_type& __new_size)
const;
2473#if __cplusplus >= 201103L && ! _GLIBCXX_INLINE_VERSION
2478 _M_move_assign(list&& __x, true_type)
noexcept
2482 std::__alloc_on_move(this->_M_get_Node_allocator(),
2483 __x._M_get_Node_allocator());
2487 _M_move_assign(list&& __x, false_type)
2489 if (__x._M_get_Node_allocator() == this->_M_get_Node_allocator())
2490 _M_move_assign(
std::move(__x), true_type{});
2494 _M_assign_dispatch(std::make_move_iterator(__x.begin()),
2495 std::make_move_iterator(__x.end()),
2500#if _GLIBCXX_USE_CXX11_ABI
2502 struct _Finalize_merge
2505 _Finalize_merge(list& __dest, list& __src,
const iterator& __src_next)
2506 : _M_dest(__dest), _M_src(__src), _M_next(__src_next)
2514 const size_t __num_unmerged =
std::distance(_M_next, _M_src.end());
2515 const size_t __orig_size = _M_src._M_get_size();
2516 _M_dest._M_inc_size(__orig_size - __num_unmerged);
2517 _M_src._M_set_size(__num_unmerged);
2522 const iterator& _M_next;
2524#if __cplusplus >= 201103L
2525 _Finalize_merge(
const _Finalize_merge&) =
delete;
2529 struct _Finalize_merge
2530 {
explicit _Finalize_merge(list&, list&,
const iterator&) { } };
2533#if !_GLIBCXX_INLINE_VERSION
2540#if _GLIBCXX_USE_CXX11_ABI
2542 _S_distance(const_iterator __first, const_iterator __last)
2546 _M_node_count()
const
2547 {
return this->_M_get_size(); }
2550 _S_distance(const_iterator, const_iterator)
2554 _M_node_count()
const
2560#if __cpp_deduction_guides >= 201606
2561 template<
typename _InputIterator,
typename _ValT
2562 =
typename iterator_traits<_InputIterator>::value_type,
2563 typename _Allocator = allocator<_ValT>,
2564 typename = _RequireInputIter<_InputIterator>,
2565 typename = _RequireAllocator<_Allocator>>
2566 list(_InputIterator, _InputIterator, _Allocator = _Allocator())
2567 -> list<_ValT, _Allocator>;
2569#if __glibcxx_ranges_to_container
2570 template<ranges::input_range _Rg,
2571 typename _Allocator = allocator<ranges::range_value_t<_Rg>>>
2572 list(from_range_t, _Rg&&, _Allocator = _Allocator())
2573 -> list<ranges::range_value_t<_Rg>, _Allocator>;
2577_GLIBCXX_END_NAMESPACE_CXX11
2589 template<
typename _Tp,
typename _Alloc>
2594#if _GLIBCXX_USE_CXX11_ABI
2595 if (__x.
size() != __y.size())
2599 typedef typename list<_Tp, _Alloc>::const_iterator const_iterator;
2600 const_iterator __end1 = __x.
end();
2601 const_iterator __end2 = __y.end();
2603 const_iterator __i1 = __x.
begin();
2604 const_iterator __i2 = __y.begin();
2605 while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
2610 return __i1 == __end1 && __i2 == __end2;
2613#if __cpp_lib_three_way_comparison
2625 template<
typename _Tp,
typename _Alloc>
2627 inline __detail::__synth3way_t<_Tp>
2628 operator<=>(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2631 __y.begin(), __y.end(),
2632 __detail::__synth3way);
2646 template<
typename _Tp,
typename _Alloc>
2649 operator<(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2650 {
return std::lexicographical_compare(__x.begin(), __x.end(),
2651 __y.begin(), __y.end()); }
2654 template<
typename _Tp,
typename _Alloc>
2657 operator!=(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2658 {
return !(__x == __y); }
2661 template<
typename _Tp,
typename _Alloc>
2664 operator>(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2665 {
return __y < __x; }
2668 template<
typename _Tp,
typename _Alloc>
2671 operator<=(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2672 {
return !(__y < __x); }
2675 template<
typename _Tp,
typename _Alloc>
2678 operator>=(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2679 {
return !(__x < __y); }
2683 template<
typename _Tp,
typename _Alloc>
2686 _GLIBCXX_NOEXCEPT_IF(
noexcept(__x.swap(__y)))
2689_GLIBCXX_END_NAMESPACE_CONTAINER
2691#if _GLIBCXX_USE_CXX11_ABI
2694 template<
typename _Tp>
2696 __distance(_GLIBCXX_STD_C::_List_iterator<_Tp> __first,
2697 _GLIBCXX_STD_C::_List_iterator<_Tp> __last,
2698 input_iterator_tag __tag)
2700 typedef _GLIBCXX_STD_C::_List_const_iterator<_Tp> _CIter;
2701 return std::__distance(_CIter(__first), _CIter(__last), __tag);
2704 template<
typename _Tp>
2706 __distance(_GLIBCXX_STD_C::_List_const_iterator<_Tp> __first,
2707 _GLIBCXX_STD_C::_List_const_iterator<_Tp> __last,
2710 typedef __detail::_List_node_header _Sentinel;
2711 _GLIBCXX_STD_C::_List_const_iterator<_Tp> __beyond = __last;
2713 const bool __whole = __first == __beyond;
2714 if (__builtin_constant_p (__whole) && __whole)
2715 return static_cast<const _Sentinel*
>(__last._M_node)->_M_size;
2718 while (__first != __last)
2726#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
2727 template<
bool _Const,
typename _Ptr>
2729 __distance(__list::_Iterator<_Const, _Ptr> __first,
2730 __list::_Iterator<_Const, _Ptr> __last,
2731 input_iterator_tag __tag)
2733 using _Tp =
typename __list::_Iterator<_Const, _Ptr>::value_type;
2734 using _Sentinel =
typename __list::_Node_traits<_Tp, _Ptr>::_Node_header;
2735 auto __beyond = __last;
2737 const bool __whole = __first == __beyond;
2738 if (__builtin_constant_p (__whole) && __whole)
2739 return static_cast<const _Sentinel&
>(*__last._M_node)._M_size;
2742 while (__first != __last)
2752#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
2755 template<
typename _Vo
idPtr>
2757 _Node_base<_VoidPtr>::swap(_Node_base& __x, _Node_base& __y)
noexcept
2759 auto __px = pointer_traits<_Base_ptr>::pointer_to(__x);
2760 auto __py = pointer_traits<_Base_ptr>::pointer_to(__y);
2762 if (__x._M_next != __px)
2764 if (__y._M_next != __py)
2768 swap(__x._M_next,__y._M_next);
2769 swap(__x._M_prev,__y._M_prev);
2770 __x._M_next->_M_prev = __x._M_prev->_M_next = __px;
2771 __y._M_next->_M_prev = __y._M_prev->_M_next = __py;
2776 __y._M_next = __x._M_next;
2777 __y._M_prev = __x._M_prev;
2778 __y._M_next->_M_prev = __y._M_prev->_M_next = __py;
2779 __x._M_next = __x._M_prev = __px;
2782 else if (__y._M_next != __py)
2785 __x._M_next = __y._M_next;
2786 __x._M_prev = __y._M_prev;
2787 __x._M_next->_M_prev = __x._M_prev->_M_next = __px;
2788 __y._M_next = __y._M_prev = __py;
2792 template<
typename _Vo
idPtr>
2794 _Node_base<_VoidPtr>::_M_transfer(_Base_ptr
const __first,
2795 _Base_ptr
const __last)
2797 __glibcxx_assert(__first != __last);
2799 auto __self = pointer_traits<_Base_ptr>::pointer_to(*
this);
2800 if (__self != __last)
2803 __last->_M_prev->_M_next = __self;
2804 __first->_M_prev->_M_next = __last;
2805 this->_M_prev->_M_next = __first;
2808 auto const __tmp = this->_M_prev;
2809 this->_M_prev = __last->_M_prev;
2810 __last->_M_prev = __first->_M_prev;
2811 __first->_M_prev = __tmp;
2815 template<
typename _Vo
idPtr>
2817 _Node_header<_VoidPtr>::_M_reverse() noexcept
2819 const auto __self = this->_M_base();
2820 auto __tmp = __self;
2824 swap(__tmp->_M_next, __tmp->_M_prev);
2827 __tmp = __tmp->_M_prev;
2829 while (__tmp != __self);
2834_GLIBCXX_END_NAMESPACE_VERSION
constexpr bool operator<=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator>=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator<(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator>(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
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.
constexpr auto lexicographical_compare_three_way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Comp __comp) -> decltype(__comp(*__first1, *__first2))
Performs dictionary comparison on ranges.
ISO C++ entities toplevel namespace is std.
typename pointer_traits< _Ptr >::template rebind< _Tp > __ptr_rebind
Convenience alias for rebinding pointers.
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
constexpr auto empty(const _Container &__cont) noexcept(noexcept(__cont.empty())) -> decltype(__cont.empty())
Return whether a container is empty.
is_nothrow_default_constructible
is_trivially_destructible
Uniform interface to all pointer-like types.
The ranges::subrange class template.
Bidirectional iterators support a superset of forward iterator operations.
Common part of a node in the list.
A standard container with linear time access to elements, and fixed time insertion/deletion at any po...
void splice(const_iterator __position, list &&__x, const_iterator __i) noexcept
Insert element from another list.
list(list &&)=default
List move constructor.
void push_back(const value_type &__x)
Add data to the end of the list.
iterator begin() noexcept
list & operator=(list &&__x) noexcept(_Node_alloc_traits::_S_nothrow_move())
List move assignment operator.
iterator insert(const_iterator __position, value_type &&__x)
Inserts given value into list before specified iterator.
allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
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.
size_type size() const noexcept
const_reference front() const noexcept
_Node_ptr _M_create_node(_Args &&... __args)
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
list(const allocator_type &__a) noexcept
Creates a list with no elements.
void reverse() noexcept
Reverse the elements in list.
list & operator=(initializer_list< value_type > __l)
List initializer list assignment operator.
reverse_iterator rbegin() noexcept
list()=default
Creates a list with no elements.
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
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.
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.
An actual node in the list.
See bits/stl_deque.h's _Deque_base for an explanation.
Uniform interface to C++98 and C++11 allocators.