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)
noexcept;
205 _M_hook(_Base_ptr
const __position)
noexcept
207 auto __self = this->_M_base();
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;
230 _M_base() const noexcept
232 return pointer_traits<_Base_ptr>::
233 pointer_to(
const_cast<_Node_base&
>(*
this));
237 using ::std::__detail::_List_size;
242 template<
typename _Vo
idPtr>
244 :
public _Node_base<_VoidPtr>, _List_size
246 _Node_header() noexcept
249 _Node_header(_Node_header&& __x) noexcept
250 : _Node_base<_VoidPtr>(__x), _List_size(__x)
252 if (__x._M_base()->_M_next == __x._M_base())
253 this->_M_next = this->_M_prev = this->_M_base();
256 this->_M_next->_M_prev = this->_M_prev->_M_next = this->_M_base();
262 _M_move_nodes(_Node_header&& __x)
noexcept
264 auto const __xnode = __x._M_base();
265 if (__xnode->_M_next == __xnode)
269 auto const __node = this->_M_base();
270 __node->_M_next = __xnode->_M_next;
271 __node->_M_prev = __xnode->_M_prev;
272 __node->_M_next->_M_prev = __node->_M_prev->_M_next = __node;
273 _List_size::operator=(__x);
281 this->_M_next = this->_M_prev = this->_M_base();
282 _List_size::operator=(_List_size());
285 void _M_reverse() noexcept;
289 template<typename _ValPtr>
290 struct _Node : public __list::_Node_base<
__ptr_rebind<_ValPtr,
void>>
292 using value_type =
typename pointer_traits<_ValPtr>::element_type;
293 using _Node_ptr = __ptr_rebind<_ValPtr, _Node>;
297 _Node(_Node&&) =
delete;
299 union _Uninit_storage
301 _Uninit_storage() noexcept { }
302 ~_Uninit_storage() { }
306 _Uninit_storage _M_u;
316 {
return pointer_traits<_Node_ptr>::pointer_to(*
this); }
319 template<
bool _Const,
typename _Ptr>
class _Iterator;
321 template<
bool _Const,
typename _Ptr>
324 using _Node = __list::_Node<_Ptr>;
326 =
typename __list::_Node_base<__ptr_rebind<_Ptr, void>>::_Base_ptr;
328 template<
typename _Tp>
329 using __maybe_const = __conditional_t<_Const, const _Tp, _Tp>;
332 using value_type =
typename pointer_traits<_Ptr>::element_type;
333 using difference_type = ptrdiff_t;
334 using iterator_category = bidirectional_iterator_tag;
335 using pointer = __maybe_const<value_type>*;
336 using reference = __maybe_const<value_type>&;
338 constexpr _Iterator() noexcept : _M_node() { }
340 _Iterator(
const _Iterator&) =
default;
341 _Iterator& operator=(
const _Iterator&) =
default;
343#ifdef __glibcxx_concepts
345 _Iterator(
const _Iterator<false, _Ptr>& __i)
requires _Const
347 template<
bool _OtherConst,
348 typename = __enable_if_t<_Const && !_OtherConst>>
350 _Iterator(
const _Iterator<_OtherConst, _Ptr>& __i)
352 : _M_node(__i._M_node) { }
355 _Iterator(_Base_ptr __x) noexcept
362 {
return static_cast<_Node&
>(*_M_node)._M_u._M_data; }
366 operator->() const noexcept
369 _GLIBCXX14_CONSTEXPR _Iterator&
370 operator++() noexcept
372 _M_node = _M_node->_M_next;
376 _GLIBCXX14_CONSTEXPR _Iterator
377 operator++(
int)
noexcept
380 _M_node = _M_node->_M_next;
384 _GLIBCXX14_CONSTEXPR _Iterator&
385 operator--() noexcept
387 _M_node = _M_node->_M_prev;
391 _GLIBCXX14_CONSTEXPR _Iterator
392 operator--(
int)
noexcept
395 _M_node = _M_node->_M_prev;
400 friend constexpr bool
401 operator==(
const _Iterator& __x,
const _Iterator& __y)
noexcept
402 {
return __x._M_node == __y._M_node; }
404#if __cpp_impl_three_way_comparison < 201907L
406 friend constexpr bool
407 operator!=(
const _Iterator& __x,
const _Iterator& __y)
noexcept
408 {
return __x._M_node != __y._M_node; }
412 template<
typename _Tp,
typename _Allocator>
413 friend class _GLIBCXX_STD_C::list;
415 friend _Iterator<!_Const, _Ptr>;
417 constexpr _Iterator<false, _Ptr>
418 _M_const_cast() const noexcept
419 {
return _Iterator<false, _Ptr>(_M_node); }
426_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
427 template<
typename _Tp>
struct _List_node;
428 template<
typename _Tp>
struct _List_iterator;
429 template<
typename _Tp>
struct _List_const_iterator;
430_GLIBCXX_END_NAMESPACE_CONTAINER
435 template<
typename _Tp,
typename _Ptr>
438#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST <= 9000
442 template<
typename _Tp>
443 struct _Node_traits<_Tp, _Tp*>
445 typedef __detail::_List_node_base _Node_base;
446 typedef __detail::_List_node_header _Node_header;
447 typedef _GLIBCXX_STD_C::_List_node<_Tp> _Node;
448 typedef _GLIBCXX_STD_C::_List_iterator<_Tp> _Iterator;
449 typedef _GLIBCXX_STD_C::_List_const_iterator<_Tp> _Const_iterator;
453#if ! _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
455 template<
typename _Tp,
typename _Ptr>
457 : _Node_traits<_Tp, _Tp*>
461 template<
typename _Tp,
typename _Ptr>
465 using _VoidPtr = __ptr_rebind<_Ptr, void>;
466 using _ValPtr = __ptr_rebind<_Ptr, _Tp>;
469 using _Node_base = __list::_Node_base<_VoidPtr>;
470 using _Node_header = __list::_Node_header<_VoidPtr>;
471 using _Node = __list::_Node<_ValPtr>;
472 using _Iterator = __list::_Iterator<false, _ValPtr>;
473 using _Const_iterator = __list::_Iterator<true, _ValPtr>;
478 template<
typename _NodeBaseT>
482 typedef _NodeBaseT _Base;
483 typedef typename _Base::_Base_ptr _Base_ptr;
485 _Scratch_list() { this->_M_next = this->_M_prev = this->_M_base(); }
487 bool empty()
const {
return this->_M_next == this->_M_base(); }
489 void swap(_Base& __l) { _Base::swap(*
this, __l); }
491 template<
typename _Iter,
typename _Cmp>
497 operator()(_Base_ptr __lhs, _Base_ptr __rhs)
498 {
return _M_cmp(*_Iter(__lhs), *_Iter(__rhs)); }
501 template<
typename _Iter>
502 struct _Ptr_cmp<_Iter, void>
505 operator()(_Base_ptr __lhs, _Base_ptr __rhs)
const
506 {
return *_Iter(__lhs) < *_Iter(__rhs); }
510 template<
typename _Cmp>
512 merge(_Base& __x, _Cmp __comp)
514 _Base_ptr __first1 = this->_M_next;
515 _Base_ptr
const __last1 = this->_M_base();
516 _Base_ptr __first2 = __x._M_next;
517 _Base_ptr
const __last2 = __x._M_base();
519 while (__first1 != __last1 && __first2 != __last2)
521 if (__comp(__first2, __first1))
523 _Base_ptr __next = __first2->_M_next;
524 __first1->_M_transfer(__first2, __next);
528 __first1 = __first1->_M_next;
530 if (__first2 != __last2)
531 this->_M_transfer(__first2, __last2);
535 void _M_take_one(_Base_ptr __i)
536 { this->_M_transfer(__i, __i->_M_next); }
539 void _M_put_all(_Base_ptr __i)
542 __i->_M_transfer(this->_M_next, this->_M_base());
547_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
550 template<
typename _Tp>
555#if __cplusplus >= 201103L
556 __gnu_cxx::__aligned_membuf<_Tp> _M_storage;
557 _Tp* _M_valptr() {
return _M_storage._M_ptr(); }
558 _Tp
const* _M_valptr()
const {
return _M_storage._M_ptr(); }
573 template<
typename _Tp>
578 typedef ptrdiff_t difference_type;
580 typedef _Tp value_type;
581 typedef _Tp* pointer;
582 typedef _Tp& reference;
592 _M_const_cast()
const _GLIBCXX_NOEXCEPT
599 {
return *
static_cast<_Node*
>(_M_node)->_M_valptr(); }
603 operator->()
const _GLIBCXX_NOEXCEPT
604 {
return static_cast<_Node*
>(_M_node)->_M_valptr(); }
607 operator++() _GLIBCXX_NOEXCEPT
609 _M_node = _M_node->_M_next;
614 operator++(
int) _GLIBCXX_NOEXCEPT
617 _M_node = _M_node->_M_next;
622 operator--() _GLIBCXX_NOEXCEPT
624 _M_node = _M_node->_M_prev;
629 operator--(
int) _GLIBCXX_NOEXCEPT
632 _M_node = _M_node->_M_prev;
640 {
return __x._M_node == __y._M_node; }
642#if __cpp_impl_three_way_comparison < 201907L
647 {
return __x._M_node != __y._M_node; }
659 template<
typename _Tp>
665 typedef ptrdiff_t difference_type;
667 typedef _Tp value_type;
668 typedef const _Tp* pointer;
669 typedef const _Tp& reference;
680 : _M_node(__x._M_node) { }
683 _M_const_cast()
const _GLIBCXX_NOEXCEPT
690 {
return *
static_cast<_Node*
>(_M_node)->_M_valptr(); }
694 operator->()
const _GLIBCXX_NOEXCEPT
695 {
return static_cast<_Node*
>(_M_node)->_M_valptr(); }
698 operator++() _GLIBCXX_NOEXCEPT
700 _M_node = _M_node->_M_next;
705 operator++(
int) _GLIBCXX_NOEXCEPT
708 _M_node = _M_node->_M_next;
713 operator--() _GLIBCXX_NOEXCEPT
715 _M_node = _M_node->_M_prev;
720 operator--(
int) _GLIBCXX_NOEXCEPT
723 _M_node = _M_node->_M_prev;
731 {
return __x._M_node == __y._M_node; }
733#if __cpp_impl_three_way_comparison < 201907L
738 {
return __x._M_node != __y._M_node; }
745_GLIBCXX_BEGIN_NAMESPACE_CXX11
747 template<
typename _Tp,
typename _Alloc>
752 rebind<_Tp>::other _Tp_alloc_type;
755 typedef __list::_Node_traits<_Tp, typename _Tp_alloc_traits::pointer>
757 typedef typename _Tp_alloc_traits::template
758 rebind<typename _Node_traits::_Node>::other _Node_alloc_type;
761#if __cplusplus < 201103L || ! _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
764 using _Node_ptr =
typename _Node_alloc_traits::pointer;
768 :
public _Node_alloc_type
770 typename _Node_traits::_Node_header _M_node;
772 _List_impl() _GLIBCXX_NOEXCEPT_IF(
777 _List_impl(
const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
778 : _Node_alloc_type(__a)
781#if __cplusplus >= 201103L
782 _List_impl(_List_impl&&) =
default;
784 _List_impl(_Node_alloc_type&& __a, _List_impl&& __x)
788 _List_impl(_Node_alloc_type&& __a) noexcept
796#if _GLIBCXX_USE_CXX11_ABI
797 size_t _M_get_size()
const {
return _M_impl._M_node._M_size; }
799 void _M_set_size(
size_t __n) { _M_impl._M_node._M_size = __n; }
801 void _M_inc_size(
size_t __n) { _M_impl._M_node._M_size += __n; }
803 void _M_dec_size(
size_t __n) { _M_impl._M_node._M_size -= __n; }
806 size_t _M_get_size()
const {
return 0; }
807 void _M_set_size(
size_t) { }
808 void _M_inc_size(
size_t) { }
809 void _M_dec_size(
size_t) { }
812 typename _Node_alloc_traits::pointer
814 {
return _Node_alloc_traits::allocate(_M_impl, 1); }
817 _M_put_node(_Node_ptr __p) _GLIBCXX_NOEXCEPT
819#if __cplusplus < 201103L || _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
820 _Node_alloc_traits::deallocate(_M_impl, __p, 1);
822#pragma GCC diagnostic push
823#pragma GCC diagnostic ignored "-Wc++17-extensions"
824 using __alloc_pointer =
typename _Node_alloc_traits::pointer;
826 _Node_alloc_traits::deallocate(_M_impl, __p, 1);
832 _Node_alloc_traits::deallocate(_M_impl, __ap, 1);
834#pragma GCC diagnostic pop
839 _M_destroy_node(_Node_ptr __p)
842#if __cplusplus < 201103L
843 _Tp_alloc_type(_M_impl).destroy(__p->_M_valptr());
845 _Node_alloc_traits::destroy(_M_impl, __p->_M_valptr());
847 using _Node =
typename _Node_traits::_Node;
848 using _Base_ptr =
typename _Node_traits::_Node_base::_Base_ptr;
849#pragma GCC diagnostic push
850#pragma GCC diagnostic ignored "-Wc++17-extensions"
853#pragma GCC diagnostic pop
855 this->_M_put_node(__p);
859 typedef _Alloc allocator_type;
862 _M_get_Node_allocator() _GLIBCXX_NOEXCEPT
865 const _Node_alloc_type&
866 _M_get_Node_allocator()
const _GLIBCXX_NOEXCEPT
869#if __cplusplus >= 201103L
875 _List_base(
const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
879#if __cplusplus >= 201103L
894 { _M_impl._M_node._M_move_nodes(
std::move(__x._M_impl._M_node)); }
902 _M_clear() _GLIBCXX_NOEXCEPT;
905 _M_init() _GLIBCXX_NOEXCEPT
906 { this->_M_impl._M_node._M_init(); }
908#if !_GLIBCXX_INLINE_VERSION
921#pragma GCC diagnostic push
922#pragma GCC diagnostic ignored "-Wc++17-extensions"
924# if __cplusplus >= 201103L
928#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
931 if (__x._M_get_Node_allocator() == _M_get_Node_allocator())
941#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
948 while (__first != __last)
950 __first = __first->_M_next;
957#if _GLIBCXX_USE_CXX11_ABI
961 {
return _S_distance(__first, __last); }
964 size_t _M_node_count()
const {
return _M_get_size(); }
966 size_t _M_distance(
const void*,
const void*)
const {
return 0; }
969 size_t _M_node_count()
const
971 return _S_distance(_M_impl._M_node._M_next, _M_impl._M_node._M_base());
974#pragma GCC diagnostic pop
1024 template<
typename _Tp,
typename _Alloc = std::allocator<_Tp> >
1027#ifdef _GLIBCXX_CONCEPT_CHECKS
1029 typedef typename _Alloc::value_type _Alloc_value_type;
1030# if __cplusplus < 201103L
1031 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
1033 __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
1036#if __cplusplus >= 201103L
1038 "std::list must have a non-const, non-volatile value_type");
1039# if __cplusplus > 201703L || defined __STRICT_ANSI__
1041 "std::list must have the same value_type as its allocator");
1046 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
1048 typedef typename _Base::_Node_alloc_type _Node_alloc_type;
1050 typedef typename _Base::_Node_traits _Node_traits;
1053 typedef _Tp value_type;
1054 typedef typename _Tp_alloc_traits::pointer pointer;
1055 typedef typename _Tp_alloc_traits::const_pointer const_pointer;
1056 typedef typename _Tp_alloc_traits::reference reference;
1057 typedef typename _Tp_alloc_traits::const_reference const_reference;
1058 typedef typename _Node_traits::_Iterator iterator;
1059 typedef typename _Node_traits::_Const_iterator const_iterator;
1062 typedef size_t size_type;
1063 typedef ptrdiff_t difference_type;
1064 typedef _Alloc allocator_type;
1069 typedef typename _Node_alloc_traits::pointer _Node_ptr;
1071 using _Base::_M_impl;
1072 using _Base::_M_put_node;
1073 using _Base::_M_get_node;
1074 using _Base::_M_get_Node_allocator;
1082#if __cplusplus < 201103L
1084 _M_create_node(
const value_type& __x)
1086 _Node_ptr __p = this->_M_get_node();
1089 _Tp_alloc_type __alloc(_M_get_Node_allocator());
1090 __alloc.construct(__p->_M_valptr(), __x);
1095 __throw_exception_again;
1100 template<
typename... _Args>
1104 auto& __alloc = _M_get_Node_allocator();
1105 auto __guard = std::__allocate_guarded_obj(__alloc);
1106 _Node_alloc_traits::construct(__alloc, __guard->_M_valptr(),
1107 std::forward<_Args>(__args)...);
1108 return __guard.release();
1119#if __cplusplus >= 201103L
1130 list(
const allocator_type& __a) _GLIBCXX_NOEXCEPT
1131 :
_Base(_Node_alloc_type(__a)) { }
1133#if __cplusplus >= 201103L
1143 list(size_type __n,
const allocator_type& __a = allocator_type())
1144 :
_Base(_Node_alloc_type(__a))
1145 { _M_default_initialize(__n); }
1155 list(size_type __n,
const value_type& __value,
1156 const allocator_type& __a = allocator_type())
1157 :
_Base(_Node_alloc_type(__a))
1158 { _M_fill_initialize(__n, __value); }
1169 list(size_type __n,
const value_type& __value = value_type(),
1170 const allocator_type& __a = allocator_type())
1171 : _Base(_Node_alloc_type(__a))
1172 { _M_fill_initialize(__n, __value); }
1184 _S_select_on_copy(__x._M_get_Node_allocator()))
1185 { _M_initialize_dispatch(__x.
begin(), __x.
end(), __false_type()); }
1187#if __cplusplus >= 201103L
1206 const allocator_type& __a = allocator_type())
1207 :
_Base(_Node_alloc_type(__a))
1208 { _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
1210 list(
const list& __x,
const __type_identity_t<allocator_type>& __a)
1211 : _Base(_Node_alloc_type(__a))
1212 { _M_initialize_dispatch(__x.
begin(), __x.
end(), __false_type()); }
1215 list(list&& __x,
const allocator_type& __a, true_type) noexcept
1216 : _Base(_Node_alloc_type(__a),
std::move(__x))
1219 list(list&& __x,
const allocator_type& __a, false_type)
1220 : _Base(_Node_alloc_type(__a))
1222 if (__x._M_get_Node_allocator() == this->_M_get_Node_allocator())
1225 insert(
begin(), std::__make_move_if_noexcept_iterator(__x.
begin()),
1226 std::__make_move_if_noexcept_iterator(__x.
end()));
1230 list(list&& __x,
const __type_identity_t<allocator_type>& __a)
1231 noexcept(_Node_alloc_traits::_S_always_equal())
1233 typename _Node_alloc_traits::is_always_equal{})
1247#if __cplusplus >= 201103L
1248 template<
typename _InputIterator,
1249 typename = std::_RequireInputIter<_InputIterator>>
1250 list(_InputIterator __first, _InputIterator __last,
1251 const allocator_type& __a = allocator_type())
1252 :
_Base(_Node_alloc_type(__a))
1253 { _M_initialize_dispatch(__first, __last, __false_type()); }
1255 template<
typename _InputIterator>
1256 list(_InputIterator __first, _InputIterator __last,
1257 const allocator_type& __a = allocator_type())
1258 : _Base(_Node_alloc_type(__a))
1261 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1262 _M_initialize_dispatch(__first, __last, _Integral());
1266#if __glibcxx_ranges_to_container
1271 template<__detail::__container_compatible_range<_Tp> _Rg>
1272 list(from_range_t, _Rg&& __rg,
const _Alloc& __a = _Alloc())
1273 : _Base(_Node_alloc_type(__a))
1275 auto __first = ranges::begin(__rg);
1276 const auto __last = ranges::end(__rg);
1277 for (; __first != __last; ++__first)
1278 emplace_back(*__first);
1282#if __cplusplus >= 201103L
1302 operator=(
const list& __x);
1304#if __cplusplus >= 201103L
1305#pragma GCC diagnostic push
1306#pragma GCC diagnostic ignored "-Wc++17-extensions"
1319 noexcept(_Node_alloc_traits::_S_nothrow_move())
1321 constexpr bool __move_storage =
1322 _Node_alloc_traits::_S_propagate_on_move_assign()
1323 || _Node_alloc_traits::_S_always_equal();
1324 if constexpr (!__move_storage)
1326 if (__x._M_get_Node_allocator() != this->_M_get_Node_allocator())
1330 _M_assign_dispatch(std::make_move_iterator(__x.
begin()),
1331 std::make_move_iterator(__x.
end()),
1340 if constexpr (_Node_alloc_traits::_S_propagate_on_move_assign())
1341 this->_M_get_Node_allocator()
1342 =
std::move(__x._M_get_Node_allocator());
1346#pragma GCC diagnostic pop
1358 this->assign(__l.begin(), __l.end());
1363#if __glibcxx_ranges_to_container
1368 template<__detail::__container_compatible_range<_Tp> _Rg>
1370 assign_range(_Rg&& __rg)
1372 static_assert(assignable_from<_Tp&, ranges::range_reference_t<_Rg>>);
1376 auto __first2 = ranges::begin(__rg);
1377 const auto __last2 = ranges::end(__rg);
1378 for (; __first1 != __last1 && __first2 != __last2;
1379 ++__first1, (void)++__first2)
1380 *__first1 = *__first2;
1381 if (__first2 == __last2)
1382 erase(__first1, __last1);
1384 insert_range(__last1,
1400 assign(size_type __n,
const value_type& __val)
1401 { _M_fill_assign(__n, __val); }
1415#if __cplusplus >= 201103L
1416 template<
typename _InputIterator,
1417 typename = std::_RequireInputIter<_InputIterator>>
1419 assign(_InputIterator __first, _InputIterator __last)
1420 { _M_assign_dispatch(__first, __last, __false_type()); }
1422 template<
typename _InputIterator>
1424 assign(_InputIterator __first, _InputIterator __last)
1427 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1428 _M_assign_dispatch(__first, __last, _Integral());
1432#if __cplusplus >= 201103L
1442 { this->_M_assign_dispatch(__l.begin(), __l.end(), __false_type()); }
1448 {
return allocator_type(_Base::_M_get_Node_allocator()); }
1458 {
return iterator(this->_M_impl._M_node._M_next); }
1468 {
return const_iterator(this->_M_impl._M_node._M_next); }
1478 {
return iterator(this->_M_impl._M_node._M_base()); }
1488 {
return const_iterator(this->_M_impl._M_node._M_base()); }
1506 const_reverse_iterator
1526 const_reverse_iterator
1530#if __cplusplus >= 201103L
1539 {
return const_iterator(this->_M_impl._M_node._M_next); }
1549 {
return const_iterator(this->_M_impl._M_node._M_base()); }
1557 const_reverse_iterator
1567 const_reverse_iterator
1577 _GLIBCXX_NODISCARD
bool
1580 return this->_M_impl._M_node._M_next == this->_M_impl._M_node._M_base();
1588#if _GLIBCXX_USE_CXX11_ABI
1589 return this->_M_get_size();
1599 {
return _Node_alloc_traits::max_size(_M_get_Node_allocator()); }
1601#if __cplusplus >= 201103L
1612 resize(size_type __new_size);
1625 resize(size_type __new_size,
const value_type& __x);
1638 resize(size_type __new_size, value_type __x = value_type());
1650 __glibcxx_requires_nonempty();
1662 __glibcxx_requires_nonempty();
1674 __glibcxx_requires_nonempty();
1675 iterator __tmp =
end();
1688 __glibcxx_requires_nonempty();
1689 const_iterator __tmp =
end();
1707 { this->_M_insert(
begin(), __x); }
1709#if __cplusplus >= 201103L
1711 push_front(value_type&& __x)
1714 template<
typename... _Args>
1715#if __cplusplus > 201402L
1720 emplace_front(_Args&&... __args)
1722 this->_M_insert(begin(), std::forward<_Args>(__args)...);
1723#if __cplusplus > 201402L
1729#if __glibcxx_ranges_to_container
1742 template<__detail::__container_compatible_range<_Tp> _Rg>
1744 prepend_range(_Rg&& __rg)
1746 list __tmp(from_range, std::forward<_Rg>(__rg), get_allocator());
1748 splice(
begin(), __tmp);
1763 template<__detail::__container_compatible_range<_Tp> _Rg>
1765 append_range(_Rg&& __rg)
1767 list __tmp(from_range, std::forward<_Rg>(__rg), get_allocator());
1769 splice(
end(), __tmp);
1787 { this->_M_erase(
begin()); }
1801 { this->_M_insert(
end(), __x); }
1803#if __cplusplus >= 201103L
1805 push_back(value_type&& __x)
1808 template<
typename... _Args>
1809#if __cplusplus > 201402L
1814 emplace_back(_Args&&... __args)
1816 this->_M_insert(end(), std::forward<_Args>(__args)...);
1817#if __cplusplus > 201402L
1836 { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
1838#if __cplusplus >= 201103L
1851 template<
typename... _Args>
1853 emplace(const_iterator __position, _Args&&... __args);
1869#if __cplusplus >= 201103L
1871 insert(const_iterator __position,
const value_type& __x);
1874 insert(const_iterator __position, value_type&& __x)
1875 {
return emplace(__position,
std::move(__x)); }
1878 insert(
iterator __position,
const value_type& __x);
1882#if __cplusplus >= 201103L
1900 {
return this->insert(__p, __l.begin(), __l.end()); }
1917#if __cplusplus >= 201103L
1919 insert(const_iterator __position, size_type __n,
const value_type& __x);
1922 insert(
iterator __position, size_type __n,
const value_type& __x)
1924 list __tmp(__n, __x, get_allocator());
1925 splice(__position, __tmp);
1944#if __cplusplus >= 201103L
1945 template<
typename _InputIterator,
1946 typename = std::_RequireInputIter<_InputIterator>>
1948 insert(const_iterator __position, _InputIterator __first,
1949 _InputIterator __last);
1951 template<
typename _InputIterator>
1953 insert(iterator __position, _InputIterator __first,
1954 _InputIterator __last)
1956 list __tmp(__first, __last, get_allocator());
1957 splice(__position, __tmp);
1961#if __glibcxx_ranges_to_container
1977 template<__detail::__container_compatible_range<_Tp> _Rg>
1979 insert_range(const_iterator __position, _Rg&& __rg)
1981 list __tmp(from_range, std::forward<_Rg>(__rg), get_allocator());
1984 auto __it = __tmp.begin();
1985 splice(__position, __tmp);
1988 return __position._M_const_cast();
2008#if __cplusplus >= 201103L
2009 erase(const_iterator __position)
noexcept;
2011 erase(iterator __position);
2033#if __cplusplus >= 201103L
2034 erase(const_iterator __first, const_iterator __last)
noexcept
2036 erase(iterator __first, iterator __last)
2039 while (__first != __last)
2040 __first = erase(__first);
2041 return __last._M_const_cast();
2058 _Node_traits::_Node_base::swap(this->_M_impl._M_node,
2059 __x._M_impl._M_node);
2061 size_t __xsize = __x._M_get_size();
2062 __x._M_set_size(this->_M_get_size());
2063 this->_M_set_size(__xsize);
2065 _Node_alloc_traits::_S_on_swap(this->_M_get_Node_allocator(),
2066 __x._M_get_Node_allocator());
2095#if __cplusplus >= 201103L
2098 splice(iterator __position,
list& __x)
2103 _M_check_equal_allocators(__x);
2105 this->_M_transfer(__position._M_const_cast(),
2108 this->_M_inc_size(__x._M_get_size());
2113#if __cplusplus >= 201103L
2115 splice(const_iterator __position,
list& __x)
noexcept
2130#if __cplusplus >= 201103L
2132 splice(const_iterator __position,
list&& __x, const_iterator __i)
noexcept
2135 splice(iterator __position,
list& __x, iterator __i)
2138 iterator __j = __i._M_const_cast();
2140 if (__position == __i || __position == __j)
2144 _M_check_equal_allocators(__x);
2146 this->_M_transfer(__position._M_const_cast(),
2147 __i._M_const_cast(), __j);
2149 this->_M_inc_size(1);
2153#if __cplusplus >= 201103L
2155 splice(const_iterator __position,
list& __x, const_iterator __i)
noexcept
2156 { splice(__position,
std::move(__x), __i); }
2172#if __cplusplus >= 201103L
2174 splice(const_iterator __position,
list&& __x, const_iterator __first,
2175 const_iterator __last)
noexcept
2178 splice(iterator __position,
list& __x, iterator __first,
2182 if (__first != __last)
2185 _M_check_equal_allocators(__x);
2187#if _GLIBCXX_USE_CXX11_ABI
2189 this->_M_inc_size(__n);
2190 __x._M_dec_size(__n);
2193 this->_M_transfer(__position._M_const_cast(),
2194 __first._M_const_cast(),
2195 __last._M_const_cast());
2199#if __cplusplus >= 201103L
2214 splice(const_iterator __position,
list& __x, const_iterator __first,
2215 const_iterator __last)
noexcept
2216 { splice(__position,
std::move(__x), __first, __last); }
2220#ifdef __glibcxx_list_remove_return_type
2221 typedef size_type __remove_return_type;
2222# define _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG \
2223 __attribute__((__abi_tag__("__cxx20")))
2225 typedef void __remove_return_type;
2226# define _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
2241 _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
2242 __remove_return_type
2243 remove(
const _Tp& __value);
2256 template<
typename _Predicate>
2257 __remove_return_type
2258 remove_if(_Predicate);
2270 _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
2271 __remove_return_type
2286 template<
typename _BinaryPredicate>
2287 __remove_return_type
2288 unique(_BinaryPredicate);
2290#undef _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG
2301#if __cplusplus >= 201103L
2326#if __cplusplus >= 201103L
2327 template<
typename _StrictWeakOrdering>
2329 merge(list&& __x, _StrictWeakOrdering __comp);
2331 template<
typename _StrictWeakOrdering>
2333 merge(list& __x, _StrictWeakOrdering __comp)
2336 template<
typename _StrictWeakOrdering>
2338 merge(list& __x, _StrictWeakOrdering __comp);
2348 { this->_M_impl._M_node._M_reverse(); }
2365 template<
typename _StrictWeakOrdering>
2367 sort(_StrictWeakOrdering);
2376 template<
typename _Integer>
2378 _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
2379 { _M_fill_initialize(
static_cast<size_type
>(__n), __x); }
2382 template<
typename _InputIterator>
2384 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
2387 for (; __first != __last; ++__first)
2388#
if __cplusplus >= 201103L
2389 emplace_back(*__first);
2391 push_back(*__first);
2398 _M_fill_initialize(size_type __n,
const value_type& __x)
2404#if __cplusplus >= 201103L
2407 _M_default_initialize(size_type __n)
2415 _M_default_append(size_type __n);
2424 template<
typename _Integer>
2426 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
2427 { _M_fill_assign(__n, __val); }
2430 template<
typename _InputIterator>
2432 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
2438 _M_fill_assign(size_type __n,
const value_type& __val);
2443 _M_transfer(iterator __position, iterator __first, iterator __last)
2444 { __position._M_node->_M_transfer(__first._M_node, __last._M_node); }
2447#if __cplusplus < 201103L
2449 _M_insert(iterator __position,
const value_type& __x)
2451 _Node_ptr __tmp = _M_create_node(__x);
2452 __tmp->_M_hook(__position._M_node);
2453 this->_M_inc_size(1);
2456 template<
typename... _Args>
2458 _M_insert(iterator __position, _Args&&... __args)
2460 _Node_ptr __tmp = _M_create_node(std::forward<_Args>(__args)...);
2461 __tmp->_M_hook(__position._M_node);
2462 this->_M_inc_size(1);
2468 _M_erase(iterator __position) _GLIBCXX_NOEXCEPT
2470 typedef typename _Node_traits::_Node _Node;
2471 this->_M_dec_size(1);
2472 __position._M_node->_M_unhook();
2473 _Node& __n =
static_cast<_Node&
>(*__position._M_node);
2474 this->_M_destroy_node(__n._M_node_ptr());
2479 _M_check_equal_allocators(
const list& __x) _GLIBCXX_NOEXCEPT
2481 if (_M_get_Node_allocator() != __x._M_get_Node_allocator())
2487 _M_resize_pos(size_type& __new_size)
const;
2489#if __cplusplus >= 201103L && ! _GLIBCXX_INLINE_VERSION
2494 _M_move_assign(list&& __x, true_type)
noexcept
2498 std::__alloc_on_move(this->_M_get_Node_allocator(),
2499 __x._M_get_Node_allocator());
2503 _M_move_assign(list&& __x, false_type)
2505 if (__x._M_get_Node_allocator() == this->_M_get_Node_allocator())
2506 _M_move_assign(
std::move(__x), true_type{});
2510 _M_assign_dispatch(std::make_move_iterator(__x.begin()),
2511 std::make_move_iterator(__x.end()),
2516#if _GLIBCXX_USE_CXX11_ABI
2518 struct _Finalize_merge
2521 _Finalize_merge(list& __dest, list& __src,
const iterator& __src_next)
2522 : _M_dest(__dest), _M_src(__src), _M_next(__src_next)
2530 const size_t __num_unmerged =
std::distance(_M_next, _M_src.end());
2531 const size_t __orig_size = _M_src._M_get_size();
2532 _M_dest._M_inc_size(__orig_size - __num_unmerged);
2533 _M_src._M_set_size(__num_unmerged);
2538 const iterator& _M_next;
2540#if __cplusplus >= 201103L
2541 _Finalize_merge(
const _Finalize_merge&) =
delete;
2545 struct _Finalize_merge
2546 {
explicit _Finalize_merge(list&, list&,
const iterator&) { } };
2549#if !_GLIBCXX_INLINE_VERSION
2556#if _GLIBCXX_USE_CXX11_ABI
2558 _S_distance(const_iterator __first, const_iterator __last)
2562 _M_node_count()
const
2563 {
return this->_M_get_size(); }
2566 _S_distance(const_iterator, const_iterator)
2570 _M_node_count()
const
2576#if __cpp_deduction_guides >= 201606
2577 template<
typename _InputIterator,
typename _ValT
2578 =
typename iterator_traits<_InputIterator>::value_type,
2579 typename _Allocator = allocator<_ValT>,
2580 typename = _RequireInputIter<_InputIterator>,
2581 typename = _RequireAllocator<_Allocator>>
2582 list(_InputIterator, _InputIterator, _Allocator = _Allocator())
2583 -> list<_ValT, _Allocator>;
2585#if __glibcxx_ranges_to_container
2586 template<ranges::input_range _Rg,
2587 typename _Allocator = allocator<ranges::range_value_t<_Rg>>>
2588 list(from_range_t, _Rg&&, _Allocator = _Allocator())
2589 -> list<ranges::range_value_t<_Rg>, _Allocator>;
2593_GLIBCXX_END_NAMESPACE_CXX11
2605 template<
typename _Tp,
typename _Alloc>
2610#if _GLIBCXX_USE_CXX11_ABI
2611 if (__x.
size() != __y.size())
2615 typedef typename list<_Tp, _Alloc>::const_iterator const_iterator;
2616 const_iterator __end1 = __x.
end();
2617 const_iterator __end2 = __y.end();
2619 const_iterator __i1 = __x.
begin();
2620 const_iterator __i2 = __y.begin();
2621 while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
2626 return __i1 == __end1 && __i2 == __end2;
2629#if __cpp_lib_three_way_comparison
2641 template<
typename _Tp,
typename _Alloc>
2643 inline __detail::__synth3way_t<_Tp>
2644 operator<=>(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2647 __y.begin(), __y.end(),
2648 __detail::__synth3way);
2662 template<
typename _Tp,
typename _Alloc>
2665 operator<(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2666 {
return std::lexicographical_compare(__x.begin(), __x.end(),
2667 __y.begin(), __y.end()); }
2670 template<
typename _Tp,
typename _Alloc>
2673 operator!=(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2674 {
return !(__x == __y); }
2677 template<
typename _Tp,
typename _Alloc>
2680 operator>(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2681 {
return __y < __x; }
2684 template<
typename _Tp,
typename _Alloc>
2687 operator<=(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2688 {
return !(__y < __x); }
2691 template<
typename _Tp,
typename _Alloc>
2694 operator>=(
const list<_Tp, _Alloc>& __x,
const list<_Tp, _Alloc>& __y)
2695 {
return !(__x < __y); }
2699 template<
typename _Tp,
typename _Alloc>
2702 _GLIBCXX_NOEXCEPT_IF(
noexcept(__x.swap(__y)))
2705_GLIBCXX_END_NAMESPACE_CONTAINER
2707#if _GLIBCXX_USE_CXX11_ABI
2710 template<
typename _Tp>
2712 __distance(_GLIBCXX_STD_C::_List_iterator<_Tp> __first,
2713 _GLIBCXX_STD_C::_List_iterator<_Tp> __last,
2714 input_iterator_tag __tag)
2716 typedef _GLIBCXX_STD_C::_List_const_iterator<_Tp> _CIter;
2717 return std::__distance(_CIter(__first), _CIter(__last), __tag);
2720 template<
typename _Tp>
2722 __distance(_GLIBCXX_STD_C::_List_const_iterator<_Tp> __first,
2723 _GLIBCXX_STD_C::_List_const_iterator<_Tp> __last,
2726 typedef __detail::_List_node_header _Sentinel;
2727 _GLIBCXX_STD_C::_List_const_iterator<_Tp> __beyond = __last;
2729 const bool __whole = __first == __beyond;
2730 if (__builtin_constant_p (__whole) && __whole)
2731 return static_cast<const _Sentinel*
>(__last._M_node)->_M_size;
2734 while (__first != __last)
2742#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
2743 template<
bool _Const,
typename _Ptr>
2745 __distance(__list::_Iterator<_Const, _Ptr> __first,
2746 __list::_Iterator<_Const, _Ptr> __last,
2747 input_iterator_tag __tag)
2749 using _Tp =
typename __list::_Iterator<_Const, _Ptr>::value_type;
2750 using _Sentinel =
typename __list::_Node_traits<_Tp, _Ptr>::_Node_header;
2751 auto __beyond = __last;
2753 const bool __whole = __first == __beyond;
2754 if (__builtin_constant_p (__whole) && __whole)
2755 return static_cast<const _Sentinel&
>(*__last._M_node)._M_size;
2758 while (__first != __last)
2768#if _GLIBCXX_USE_ALLOC_PTR_FOR_LIST
2771 template<
typename _Vo
idPtr>
2773 _Node_base<_VoidPtr>::swap(_Node_base& __x, _Node_base& __y)
noexcept
2775 auto __px = __x._M_base();
2776 auto __py = __x._M_base();
2778 if (__x._M_next != __px)
2780 if (__y._M_next != __py)
2784 swap(__x._M_next,__y._M_next);
2785 swap(__x._M_prev,__y._M_prev);
2786 __x._M_next->_M_prev = __x._M_prev->_M_next = __px;
2787 __y._M_next->_M_prev = __y._M_prev->_M_next = __py;
2792 __y._M_next = __x._M_next;
2793 __y._M_prev = __x._M_prev;
2794 __y._M_next->_M_prev = __y._M_prev->_M_next = __py;
2795 __x._M_next = __x._M_prev = __px;
2798 else if (__y._M_next != __py)
2801 __x._M_next = __y._M_next;
2802 __x._M_prev = __y._M_prev;
2803 __x._M_next->_M_prev = __x._M_prev->_M_next = __px;
2804 __y._M_next = __y._M_prev = __py;
2808 template<
typename _Vo
idPtr>
2810 _Node_base<_VoidPtr>::_M_transfer(_Base_ptr
const __first,
2811 _Base_ptr
const __last)
noexcept
2813 __glibcxx_assert(__first != __last);
2815 auto __self = _M_base();
2816 if (__self != __last)
2819 __last->_M_prev->_M_next = __self;
2820 __first->_M_prev->_M_next = __last;
2821 this->_M_prev->_M_next = __first;
2824 auto const __tmp = this->_M_prev;
2825 this->_M_prev = __last->_M_prev;
2826 __last->_M_prev = __first->_M_prev;
2827 __first->_M_prev = __tmp;
2831 template<
typename _Vo
idPtr>
2833 _Node_header<_VoidPtr>::_M_reverse() noexcept
2835 const auto __self = this->_M_base();
2836 auto __tmp = __self;
2840 swap(__tmp->_M_next, __tmp->_M_prev);
2843 __tmp = __tmp->_M_prev;
2845 while (__tmp != __self);
2850_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.