STLdoc
STLdocumentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | List of all members
list< _Ty, _Alloc > Class Template Reference
Inheritance diagram for list< _Ty, _Alloc >:
_List_buy< _Ty, _Alloc > _List_alloc<!is_empty< _Alloc >::value, _List_base_types< _Ty, _Alloc > > _List_val< _List_base_types< _Ty, _Alloc >::_Val_types > _Container_base0

Public Types

typedef list< _Ty, _Alloc_Myt
 
typedef _List_buy< _Ty, _Alloc_Mybase
 
typedef _Mybase::_Node _Node
 
typedef _Mybase::_Nodeptr _Nodeptr
 
typedef _Mybase::_Alty _Alty
 
typedef _Alloc allocator_type
 
typedef _Mybase::size_type size_type
 
typedef _Mybase::difference_type difference_type
 
typedef _Mybase::pointer pointer
 
typedef _Mybase::const_pointer const_pointer
 
typedef _Mybase::reference reference
 
typedef _Mybase::const_reference const_reference
 
typedef _Mybase::value_type value_type
 
typedef _Mybase::const_iterator const_iterator
 
typedef _Mybase::iterator iterator
 
typedef _Mybase::_Unchecked_const_iterator _Unchecked_const_iterator
 
typedef _Mybase::_Unchecked_iterator _Unchecked_iterator
 
typedef _STD reverse_iterator< iteratorreverse_iterator
 
typedef _STD reverse_iterator< const_iteratorconst_reverse_iterator
 
- Public Types inherited from _List_buy< _Ty, _Alloc >
typedef _List_alloc<!is_empty< _Alloc >::value, _List_base_types< _Ty, _Alloc > > _Mybase
 
typedef _Mybase::_Alty _Alty
 
typedef _Mybase::_Nodeptr _Nodeptr
 
- Public Types inherited from _List_alloc<!is_empty< _Alloc >::value, _List_base_types< _Ty, _Alloc > >
typedef _List_alloc< _Al_has_storage, _List_base_types< _Ty, _Alloc > > _Myt
 
typedef _List_base_types< _Ty, _Alloc >::_Alloc _Alloc
 
typedef _List_base_types< _Ty, _Alloc >::_Alnod_type _Alty
 
typedef _List_base_types< _Ty, _Alloc >::_Node _Node
 
typedef _List_base_types< _Ty, _Alloc >::_Nodeptr _Nodeptr
 
- Public Types inherited from _List_val< _List_base_types< _Ty, _Alloc >::_Val_types >
typedef _List_val< _List_base_types< _Ty, _Alloc >::_Val_types > _Myt
 
typedef _List_base_types< _Ty, _Alloc >::_Val_types::_Nodeptr _Nodeptr
 
typedef _Nodeptr_Nodepref
 
typedef _List_base_types< _Ty, _Alloc >::_Val_types::value_type value_type
 
typedef _List_base_types< _Ty, _Alloc >::_Val_types::size_type size_type
 
typedef _List_base_types< _Ty, _Alloc >::_Val_types::difference_type difference_type
 
typedef _List_base_types< _Ty, _Alloc >::_Val_types::pointer pointer
 
typedef _List_base_types< _Ty, _Alloc >::_Val_types::const_pointer const_pointer
 
typedef _List_base_types< _Ty, _Alloc >::_Val_types::reference reference
 
typedef _List_base_types< _Ty, _Alloc >::_Val_types::const_reference const_reference
 
typedef _List_const_iterator< _Mytconst_iterator
 
typedef _List_iterator< _Mytiterator
 
typedef _List_unchecked_const_iterator< _Myt_Unchecked_const_iterator
 
typedef _List_unchecked_iterator< _Myt_Unchecked_iterator
 

Public Member Functions

 list ()
 
 list (const _Alloc &_Al)
 
 list (size_type _Count)
 
 list (size_type _Count, const _Ty &_Val)
 
 list (size_type _Count, const _Ty &_Val, const _Alloc &_Al)
 
 list (const _Myt &_Right)
 
 list (const _Myt &_Right, const _Alloc &_Al)
 
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>::type>
 list (_Iter _First, _Iter _Last)
 
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>::type>
 list (_Iter _First, _Iter _Last, const _Alloc &_Al)
 
template<class _Iter >
void _Construct (_Iter _First, _Iter _Last)
 
void _Construct_n (size_type _Count, const _Ty &_Val)
 
 list (_Myt &&_Right)
 
 list (_Myt &&_Right, const _Alloc &_Al)
 
_Mytoperator= (_Myt &&_Right)
 
void _Assign_rv (_Myt &&_Right)
 
void push_front (_Ty &&_Val)
 
void push_back (_Ty &&_Val)
 
iterator insert (const_iterator _Where, _Ty &&_Val)
 
template<class... _Valty>
void emplace_front (_Valty &&..._Val)
 
template<class... _Valty>
void emplace_back (_Valty &&..._Val)
 
template<class... _Valty>
iterator emplace (const_iterator _Where, _Valty &&..._Val)
 
template<class... _Valty>
void _Insert (_Unchecked_const_iterator _Where, _Valty &&..._Val)
 
 list (_XSTD initializer_list< _Ty > _Ilist, const _Alloc &_Al=allocator_type())
 
_Mytoperator= (_XSTD initializer_list< _Ty > _Ilist)
 
void assign (_XSTD initializer_list< _Ty > _Ilist)
 
iterator insert (const_iterator _Where, _XSTD initializer_list< _Ty > _Ilist)
 
 ~list () _NOEXCEPT
 
_Mytoperator= (const _Myt &_Right)
 
iterator begin () _NOEXCEPT
 
const_iterator begin () const _NOEXCEPT
 
iterator end () _NOEXCEPT
 
const_iterator end () const _NOEXCEPT
 
_Unchecked_iterator _Unchecked_begin ()
 
_Unchecked_const_iterator _Unchecked_begin () const
 
_Unchecked_iterator _Unchecked_end ()
 
_Unchecked_const_iterator _Unchecked_end () const
 
iterator _Make_iter (const_iterator _Where) const _NOEXCEPT
 
iterator _Make_iter (_Unchecked_const_iterator _Where) const
 
reverse_iterator rbegin () _NOEXCEPT
 
const_reverse_iterator rbegin () const _NOEXCEPT
 
reverse_iterator rend () _NOEXCEPT
 
const_reverse_iterator rend () const _NOEXCEPT
 
const_iterator cbegin () const _NOEXCEPT
 
const_iterator cend () const _NOEXCEPT
 
const_reverse_iterator crbegin () const _NOEXCEPT
 
const_reverse_iterator crend () const _NOEXCEPT
 
void resize (size_type _Newsize)
 
void resize (size_type _Newsize, const _Ty &_Val)
 
size_type size () const _NOEXCEPT
 
size_type max_size () const _NOEXCEPT
 
bool empty () const _NOEXCEPT
 
allocator_type get_allocator () const _NOEXCEPT
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void push_front (const _Ty &_Val)
 
void pop_front ()
 
void push_back (const _Ty &_Val)
 
void pop_back ()
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, void >::type assign (_Iter _First, _Iter _Last)
 
template<class _TArg >
void _Reusenode (iterator _Where, _TArg &&_Arg)
 
void assign (size_type _Count, const _Ty &_Val)
 
iterator insert (const_iterator _Where, const _Ty &_Val)
 
iterator insert (const_iterator _Where, size_type _Count, const _Ty &_Val)
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, iterator >::type insert (const_iterator _Where, _Iter _First, _Iter _Last)
 
template<class _Iter >
void _Insert_range (_Unchecked_const_iterator _Where, _Iter _First, _Iter _Last, input_iterator_tag)
 
template<class _Iter >
void _Insert_range (_Unchecked_const_iterator _Where, _Iter _First, _Iter _Last, forward_iterator_tag)
 
_Nodeptr _Unlinknode (const_iterator _Where)
 
iterator erase (const_iterator _Where)
 
void _Unchecked_erase (_Unchecked_const_iterator _Where)
 
iterator erase (const_iterator _First, const_iterator _Last)
 
void clear () _NOEXCEPT
 
void swap (_Myt &_Right)
 
void splice (const_iterator _Where, _Myt &_Right)
 
void splice (const_iterator _Where, _Myt &&_Right)
 
void splice (const_iterator _Where, _Myt &_Right, const_iterator _First)
 
void splice (const_iterator _Where, _Myt &&_Right, const_iterator _First)
 
void splice (const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
 
void splice (const_iterator _Where, _Myt &&_Right, const_iterator _First, const_iterator _Last)
 
void remove (const _Ty &_Val)
 
template<class _Pr1 >
void remove_if (_Pr1 _Pred)
 
void unique ()
 
template<class _Pr2 >
void unique (_Pr2 _Pred)
 
void merge (_Myt &_Right)
 
void merge (_Myt &&_Right)
 
template<class _Pr2 >
void merge (_Myt &_Right, _Pr2 _Pred)
 
template<class _Pr2 >
void merge (_Myt &&_Right, _Pr2 _Pred)
 
void sort ()
 
template<class _Pr2 >
void sort (_Pr2 _Pred)
 
void reverse () _NOEXCEPT
 
void _Splice (const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last, size_type _Count)
 
void _Splice_same (const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last, size_type _Count)
 
void _Unchecked_splice (_Unchecked_const_iterator _Where, _Unchecked_const_iterator _First, _Unchecked_const_iterator _Last)
 
void _Tidy ()
 
void _Insert_n (_Unchecked_const_iterator _Where, size_type _Count, const _Ty &_Val)
 
void _Incsize (size_type _Count)
 
- Public Member Functions inherited from _List_buy< _Ty, _Alloc >
 _List_buy (const _Alloc &_Al=_Alloc())
 
template<class... _Valty>
_Nodeptr _Buynode (_Nodeptr _Next, _Nodeptr _Prev, _Valty &&..._Val)
 
void _Freenode (_Nodeptr _Pnode)
 
- Public Member Functions inherited from _List_alloc<!is_empty< _Alloc >::value, _List_base_types< _Ty, _Alloc > >
 _List_alloc (const _Alloc &_Al=_Alloc())
 
 ~_List_alloc () _NOEXCEPT
 
void _Change_alloc (const _Alty &_Al)
 
void _Swap_alloc (_Myt &_Right)
 
_Nodeptr _Buyheadnode ()
 
void _Freeheadnode (_Nodeptr _Pnode)
 
_Nodeptr _Buynode0 (_Nodeptr _Next, _Nodeptr _Prev)
 
_Alty_Getal ()
 
const _Alty_Getal () const
 
- Public Member Functions inherited from _List_val< _List_base_types< _Ty, _Alloc >::_Val_types >
 _List_val ()
 
- Public Member Functions inherited from _Container_base0
void _Orphan_all ()
 
void _Swap_all (_Container_base0 &)
 

Additional Inherited Members

- Static Public Member Functions inherited from _List_val< _List_base_types< _Ty, _Alloc >::_Val_types >
static _Nodepref _Nextnode (_Nodeptr _Pnode)
 
static _Nodepref _Prevnode (_Nodeptr _Pnode)
 
static reference _Myval (_Nodeptr _Pnode)
 
- Public Attributes inherited from _List_alloc<!is_empty< _Alloc >::value, _List_base_types< _Ty, _Alloc > >
_List_base_types< _Ty, _Alloc >::_Alnod_type _Alnod
 
- Public Attributes inherited from _List_val< _List_base_types< _Ty, _Alloc >::_Val_types >
_Nodeptr _Myhead
 
size_type _Mysize
 

Member Typedef Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::_Alty list< _Ty, _Alloc >::_Alty
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _List_buy<_Ty, _Alloc> list< _Ty, _Alloc >::_Mybase
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef list<_Ty, _Alloc> list< _Ty, _Alloc >::_Myt
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::_Node list< _Ty, _Alloc >::_Node
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::_Nodeptr list< _Ty, _Alloc >::_Nodeptr
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::_Unchecked_const_iterator list< _Ty, _Alloc >::_Unchecked_const_iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::_Unchecked_iterator list< _Ty, _Alloc >::_Unchecked_iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Alloc list< _Ty, _Alloc >::allocator_type
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::const_iterator list< _Ty, _Alloc >::const_iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::const_pointer list< _Ty, _Alloc >::const_pointer
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::const_reference list< _Ty, _Alloc >::const_reference
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _STD reverse_iterator<const_iterator> list< _Ty, _Alloc >::const_reverse_iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::difference_type list< _Ty, _Alloc >::difference_type
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::iterator list< _Ty, _Alloc >::iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::pointer list< _Ty, _Alloc >::pointer
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::reference list< _Ty, _Alloc >::reference
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _STD reverse_iterator<iterator> list< _Ty, _Alloc >::reverse_iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::size_type list< _Ty, _Alloc >::size_type
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::value_type list< _Ty, _Alloc >::value_type

Constructor & Destructor Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( )
inline
890  : _Mybase()
891  { // construct empty list
892  }
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( const _Alloc _Al)
inlineexplicit
895  : _Mybase(_Al)
896  { // construct empty list, allocator
897  }
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( size_type  _Count)
inlineexplicit
900  : _Mybase()
901  { // construct list from _Count * _Ty()
902  resize(_Count);
903  }
void resize(size_type _Newsize)
Definition: list:1206
_Diff _Count
Definition: algorithm:1941
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( size_type  _Count,
const _Ty &  _Val 
)
inline
906  : _Mybase()
907  { // construct list from _Count * _Val
909  }
void _Construct_n(size_type _Count, const _Ty &_Val)
Definition: list:971
_Diff _Count
Definition: algorithm:1941
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( size_type  _Count,
const _Ty &  _Val,
const _Alloc _Al 
)
inline
912  : _Mybase(_Al)
913  { // construct list from _Count * _Val, allocator
915  }
void _Construct_n(size_type _Count, const _Ty &_Val)
Definition: list:971
_Diff _Count
Definition: algorithm:1941
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( const _Myt _Right)
inline
919  : _Mybase(_Right._Getal().select_on_container_copy_construction())
920 
921 
922  { // construct list by copying _Right
923  _TRY_BEGIN
924  insert(begin(), _Right.begin(), _Right.end());
925  _CATCH_ALL
926  _Tidy();
927  _RERAISE;
928  _CATCH_END
929  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator begin() _NOEXCEPT
Definition: list:1114
void _Tidy()
Definition: list:1881
#define _CATCH_ALL
Definition: xstddef:62
#define _RERAISE
Definition: xstddef:74
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
iterator insert(const_iterator _Where, _Ty &&_Val)
Definition: list:1026
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( const _Myt _Right,
const _Alloc _Al 
)
inline
932  : _Mybase(_Al)
933  { // construct list by copying _Right, allocator
934  _TRY_BEGIN
935  insert(begin(), _Right.begin(), _Right.end());
936  _CATCH_ALL
937  _Tidy();
938  _RERAISE;
939  _CATCH_END
940  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator begin() _NOEXCEPT
Definition: list:1114
void _Tidy()
Definition: list:1881
#define _CATCH_ALL
Definition: xstddef:62
#define _RERAISE
Definition: xstddef:74
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
iterator insert(const_iterator _Where, _Ty &&_Val)
Definition: list:1026
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>::type>
list< _Ty, _Alloc >::list ( _Iter  _First,
_Iter  _Last 
)
inline
946  : _Mybase()
947  { // construct list from [_First, _Last)
948  _Construct(_First, _Last);
949  }
void _Construct(_Iter _First, _Iter _Last)
Definition: list:961
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>::type>
list< _Ty, _Alloc >::list ( _Iter  _First,
_Iter  _Last,
const _Alloc _Al 
)
inline
955  : _Mybase(_Al)
956  { // construct list, allocator from [_First, _Last)
957  _Construct(_First, _Last);
958  }
void _Construct(_Iter _First, _Iter _Last)
Definition: list:961
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( _Myt &&  _Right)
inline
983  : _Mybase(_Right._Getal())
984  { // construct list by moving _Right
985  _Assign_rv(_STD forward<_Myt>(_Right));
986  }
void _Assign_rv(_Myt &&_Right)
Definition: list:1009
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( _Myt &&  _Right,
const _Alloc _Al 
)
inline
989  : _Mybase(_Al)
990  { // construct list by moving _Right, allocator
991  _Assign_rv(_STD forward<_Myt>(_Right));
992  }
void _Assign_rv(_Myt &&_Right)
Definition: list:1009
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::list ( _XSTD initializer_list< _Ty >  _Ilist,
const _Alloc _Al = allocator_type() 
)
inline
1071  : _Mybase(_Al)
1072  { // construct from initializer_list
1073  insert(begin(), _Ilist.begin(), _Ilist.end());
1074  }
iterator begin() _NOEXCEPT
Definition: list:1114
_List_buy< _Ty, _Alloc > _Mybase
Definition: list:865
iterator insert(const_iterator _Where, _Ty &&_Val)
Definition: list:1026
template<class _Ty, class _Alloc = allocator<_Ty>>
list< _Ty, _Alloc >::~list ( )
inline
1094  { // destroy the object
1095  _Tidy();
1096  }
void _Tidy()
Definition: list:1881

Member Function Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::_Assign_rv ( _Myt &&  _Right)
inline
1010  { // swap with empty *this, same allocator
1011  this->_Swap_all(_Right);
1012  _Swap_adl(this->_Myhead, _Right._Myhead);
1013  _STD swap(this->_Mysize, _Right._Mysize);
1014  }
void swap(_Myt &_Right)
Definition: list:1508
void _Swap_all(_Container_base0 &)
Definition: xutility:46
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void list< _Ty, _Alloc >::_Construct ( _Iter  _First,
_Iter  _Last 
)
inline
962  { // construct list from [_First, _Last), input iterators
963  _TRY_BEGIN
964  insert(begin(), _First, _Last);
965  _CATCH_ALL
966  _Tidy();
967  _RERAISE;
968  _CATCH_END
969  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator begin() _NOEXCEPT
Definition: list:1114
void _Tidy()
Definition: list:1881
#define _CATCH_ALL
Definition: xstddef:62
#define _RERAISE
Definition: xstddef:74
iterator insert(const_iterator _Where, _Ty &&_Val)
Definition: list:1026
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::_Construct_n ( size_type  _Count,
const _Ty &  _Val 
)
inline
973  { // construct from _Count * _Val
974  _TRY_BEGIN
976  _CATCH_ALL
977  _Tidy();
978  _RERAISE;
979  _CATCH_END
980  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
_Unchecked_iterator _Unchecked_begin()
Definition: list:1134
void _Tidy()
Definition: list:1881
#define _CATCH_ALL
Definition: xstddef:62
_Diff _Count
Definition: algorithm:1941
void _Insert_n(_Unchecked_const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: list:1886
#define _RERAISE
Definition: xstddef:74
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::_Incsize ( size_type  _Count)
inline
1905  { // alter element count, with checking
1906  if (max_size() - this->_Mysize - 1 < _Count)
1907  _Xlength_error("list<T> too long");
1908  this->_Mysize += _Count;
1909  }
size_type max_size() const _NOEXCEPT
Definition: list:1239
_Diff _Count
Definition: algorithm:1941
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
void list< _Ty, _Alloc >::_Insert ( _Unchecked_const_iterator  _Where,
_Valty &&...  _Val 
)
inline
1058  { // insert element at _Where
1059  _Nodeptr _Pnode = _Where._Mynode();
1060  _Nodeptr _Newnode =
1061  this->_Buynode(_Pnode, this->_Prevnode(_Pnode),
1062  _STD forward<_Valty>(_Val)...);
1063  _Incsize(1);
1064  this->_Prevnode(_Pnode) = _Newnode;
1065  this->_Nextnode(this->_Prevnode(_Newnode)) = _Newnode;
1066  }
void _Incsize(size_type _Count)
Definition: list:1904
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
static _Nodepref _Prevnode(_Nodeptr _Pnode)
Definition: list:536
_Nodeptr _Buynode(_Nodeptr _Next, _Nodeptr _Prev, _Valty &&..._Val)
Definition: list:827
_Mybase::_Nodeptr _Nodeptr
Definition: list:867
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::_Insert_n ( _Unchecked_const_iterator  _Where,
size_type  _Count,
const _Ty &  _Val 
)
inline
1888  { // insert _Count * _Val at _Where
1889  size_type _Countsave = _Count;
1890 
1891  _TRY_BEGIN
1892  for (; 0 < _Count; --_Count)
1893  _Insert(_Where, _Val);
1894  _CATCH_ALL
1895  for (; _Count < _Countsave; ++_Count)
1896  { // undo inserts
1897  _Unchecked_const_iterator _Before = _Where;
1898  _Unchecked_erase(--_Before);
1899  }
1900  _RERAISE;
1901  _CATCH_END
1902  }
_Mybase::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: list:882
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
_Mybase::size_type size_type
Definition: list:871
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
#define _CATCH_ALL
Definition: xstddef:62
void _Unchecked_erase(_Unchecked_const_iterator _Where)
Definition: list:1463
_Diff _Count
Definition: algorithm:1941
#define _RERAISE
Definition: xstddef:74
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void list< _Ty, _Alloc >::_Insert_range ( _Unchecked_const_iterator  _Where,
_Iter  _First,
_Iter  _Last,
input_iterator_tag   
)
inline
1399  { // insert [_First, _Last) at _Where, input iterators
1400  size_type _Num = 0;
1401 
1402  _TRY_BEGIN
1403  for (; _First != _Last; ++_First, ++_Num)
1404  _Insert(_Where, *_First);
1405  _CATCH_ALL
1406  for (; 0 < _Num; --_Num)
1407  { // undo inserts
1408  _Unchecked_const_iterator _Before = _Where;
1409  _Unchecked_erase(--_Before);
1410  }
1411  _RERAISE;
1412  _CATCH_END
1413  }
_Mybase::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: list:882
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
_Mybase::size_type size_type
Definition: list:871
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
#define _CATCH_ALL
Definition: xstddef:62
void _Unchecked_erase(_Unchecked_const_iterator _Where)
Definition: list:1463
#define _RERAISE
Definition: xstddef:74
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void list< _Ty, _Alloc >::_Insert_range ( _Unchecked_const_iterator  _Where,
_Iter  _First,
_Iter  _Last,
forward_iterator_tag   
)
inline
1418  { // insert [_First, _Last) at _Where, forward iterators
1419  _DEBUG_RANGE(_First, _Last);
1420  _Iter _Next = _First;
1421 
1422  _TRY_BEGIN
1423  for (; _First != _Last; ++_First)
1424  _Insert(_Where, *_First);
1425  _CATCH_ALL
1426  for (; _Next != _First; ++_Next)
1427  { // undo inserts
1428  _Unchecked_const_iterator _Before = _Where;
1429  _Unchecked_erase(--_Before);
1430  }
1431  _RERAISE;
1432  _CATCH_END
1433  }
_Mybase::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: list:882
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
#define _CATCH_ALL
Definition: xstddef:62
void _Unchecked_erase(_Unchecked_const_iterator _Where)
Definition: list:1463
#define _RERAISE
Definition: xstddef:74
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::_Make_iter ( const_iterator  _Where) const
inline
1157  { // make iterator from const_iterator
1158  return (iterator(_Where._Ptr, this));
1159  }
_Mybase::iterator iterator
Definition: list:880
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::_Make_iter ( _Unchecked_const_iterator  _Where) const
inline
1162  { // make iterator from _Unchecked_const_iterator
1163  return (iterator(_Where._Ptr, this));
1164  }
_Mybase::iterator iterator
Definition: list:880
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _TArg >
void list< _Ty, _Alloc >::_Reusenode ( iterator  _Where,
_TArg &&  _Arg 
)
inline
1314  { // destroy the element at _Where and reconstruct from _Arg
1315  _TRY_BEGIN
1316  this->_Getal().destroy(
1317  _STD addressof(this->_Myval(_Where._Ptr)));
1318  this->_Getal().construct(
1319  _STD addressof(this->_Myval(_Where._Ptr)),
1320  _STD forward<_TArg>(_Arg));
1321  _CATCH_ALL
1322  _Unlinknode(_Where);
1323  this->_Getal().destroy(
1324  _STD addressof(this->_Nextnode(_Where._Ptr)));
1325  this->_Getal().destroy(
1326  _STD addressof(this->_Prevnode(_Where._Ptr)));
1327  this->_Getal().deallocate(_Where._Ptr, 1);
1328  _RERAISE;
1329  _CATCH_END
1330  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
#define _TRY_BEGIN
Definition: xstddef:60
_Nodeptr _Unlinknode(const_iterator _Where)
Definition: list:1435
#define _CATCH_END
Definition: xstddef:63
static _Nodepref _Prevnode(_Nodeptr _Pnode)
Definition: list:536
#define _CATCH_ALL
Definition: xstddef:62
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
static reference _Myval(_Nodeptr _Pnode)
Definition: list:541
#define _RERAISE
Definition: xstddef:74
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::_Splice ( const_iterator  _Where,
_Myt _Right,
const_iterator  _First,
const_iterator  _Last,
size_type  _Count 
)
inline
1773  { // splice _Right [_First, _Last) before _Where
1774  #if _ITERATOR_DEBUG_LEVEL == 2
1775  if (_Where._Getcont() != this)
1776  _DEBUG_ERROR("list splice iterator outside range");
1777  if (this->_Getal() != _Right._Getal())
1778  _DEBUG_ERROR("list containers incompatible for splice");
1779 
1780  if (this != &_Right)
1781  { // transfer ownership
1782  _Lockit _Lock(_LOCK_DEBUG);
1783 
1784  const bool _One = _Count == 1;
1785  const bool _All = _Count == _Right.size();
1786  const bool _Some = !_One && !_All;
1787 
1788  _Nodeptr _Oldprev = _First._Ptr->_Prev;
1789 
1790  if (_Some)
1791  for (_Nodeptr _Ptr = _First._Ptr; _Ptr != _Last._Ptr;
1792  _Ptr = _Ptr->_Next)
1793  { // mark _Prev pointers
1794  _Ptr->_Prev = 0;
1795  }
1796 
1797  const_iterator **_Pnext = (const_iterator **)_Right._Getpfirst();
1798 
1799  if (_Pnext == 0)
1800  _DEBUG_ERROR("list container corrupted");
1801 
1802  while (*_Pnext != 0)
1803  { // check the iterator
1804  const_iterator& _Iter = **_Pnext;
1805 
1806  if ((_One && _Iter._Ptr == _First._Ptr)
1807  || (_All && _Iter._Ptr != _Right._Myhead)
1808  || (_Some && _Iter._Ptr->_Prev == 0))
1809  { // adopt the iterator
1810  *_Pnext = (const_iterator *)_Iter._Mynextiter;
1811  _Iter._Myproxy = this->_Myproxy;
1812  _Iter._Mynextiter = this->_Myproxy->_Myfirstiter;
1813  this->_Myproxy->_Myfirstiter = &_Iter;
1814  }
1815  else
1816  { // skip the iterator
1817  _Pnext = (const_iterator **)_Iter._Getpnext();
1818  }
1819  }
1820 
1821  if (_Some)
1822  for (_Nodeptr _Ptr = _First._Ptr; _Ptr != _Last._Ptr;
1823  _Ptr = _Ptr->_Next)
1824  { // restore _Prev pointers
1825  _Ptr->_Prev = _Oldprev;
1826  _Oldprev = _Ptr;
1827  }
1828  }
1829 
1830  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1831  if (this->_Getal() != _Right._Getal())
1832  _XSTD terminate();
1833  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1834 
1835  _Splice_same(_Where, _Right, _First, _Last, _Count);
1836  }
void _Splice_same(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last, size_type _Count)
Definition: list:1838
void __CRTDECL terminate()
Definition: exception:303
_Mybase::const_iterator const_iterator
Definition: list:879
#define _XSTD
Definition: xstddef:20
#define _LOCK_DEBUG
Definition: yvals.h:615
_Diff _Count
Definition: algorithm:1941
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_Mybase::_Nodeptr _Nodeptr
Definition: list:867
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::_Splice_same ( const_iterator  _Where,
_Myt _Right,
const_iterator  _First,
const_iterator  _Last,
size_type  _Count 
)
inline
1841  { // splice _Right [_First, _Last) before _Where
1842  if (this != &_Right)
1843  { // splicing from another list, adjust counts
1844  _Incsize(_Count);
1845  _Right._Mysize -= _Count;
1846  }
1847  this->_Nextnode(this->_Prevnode(_First._Mynode())) =
1848  _Last._Mynode();
1849  this->_Nextnode(this->_Prevnode(_Last._Mynode())) =
1850  _Where._Mynode();
1851  this->_Nextnode(this->_Prevnode(_Where._Mynode())) =
1852  _First._Mynode();
1853 
1854  _Nodeptr _Pnode = this->_Prevnode(_Where._Mynode());
1855  this->_Prevnode(_Where._Mynode()) =
1856  this->_Prevnode(_Last._Mynode());
1857  this->_Prevnode(_Last._Mynode()) =
1858  this->_Prevnode(_First._Mynode());
1859  this->_Prevnode(_First._Mynode()) = _Pnode;
1860  }
void _Incsize(size_type _Count)
Definition: list:1904
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
static _Nodepref _Prevnode(_Nodeptr _Pnode)
Definition: list:536
_Diff _Count
Definition: algorithm:1941
_Mybase::_Nodeptr _Nodeptr
Definition: list:867
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::_Tidy ( )
inline
1882  { // free all storage
1883  clear();
1884  }
void clear() _NOEXCEPT
Definition: list:1490
template<class _Ty, class _Alloc = allocator<_Ty>>
_Unchecked_iterator list< _Ty, _Alloc >::_Unchecked_begin ( )
inline
1135  { // return iterator for beginning of mutable sequence
1136  return (_Unchecked_iterator(this->_Nextnode(this->_Myhead),
1137  this));
1138  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
_Mybase::_Unchecked_iterator _Unchecked_iterator
Definition: list:884
template<class _Ty, class _Alloc = allocator<_Ty>>
_Unchecked_const_iterator list< _Ty, _Alloc >::_Unchecked_begin ( ) const
inline
1141  { // return iterator for beginning of nonmutable sequence
1142  return (_Unchecked_const_iterator(this->_Nextnode(this->_Myhead),
1143  this));
1144  }
_Mybase::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: list:882
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
template<class _Ty, class _Alloc = allocator<_Ty>>
_Unchecked_iterator list< _Ty, _Alloc >::_Unchecked_end ( )
inline
1147  { // return unchecked iterator for end of mutable sequence
1148  return (_Unchecked_iterator(this->_Myhead, this));
1149  }
_Mybase::_Unchecked_iterator _Unchecked_iterator
Definition: list:884
template<class _Ty, class _Alloc = allocator<_Ty>>
_Unchecked_const_iterator list< _Ty, _Alloc >::_Unchecked_end ( ) const
inline
1152  { // return unchecked iterator for end of nonmutable sequence
1153  return (_Unchecked_const_iterator(this->_Myhead, this));
1154  }
_Mybase::_Unchecked_const_iterator _Unchecked_const_iterator
Definition: list:882
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::_Unchecked_erase ( _Unchecked_const_iterator  _Where)
inline
1464  { // erase element at _Where
1465  _Nodeptr _Pnode = _Where._Mynode();
1466 
1467  this->_Nextnode(this->_Prevnode(_Pnode)) =
1468  this->_Nextnode(_Pnode);
1469  this->_Prevnode(this->_Nextnode(_Pnode)) =
1470  this->_Prevnode(_Pnode);
1471  this->_Freenode(_Pnode);
1472  --this->_Mysize;
1473  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
static _Nodepref _Prevnode(_Nodeptr _Pnode)
Definition: list:536
void _Freenode(_Nodeptr _Pnode)
Definition: list:845
_Mybase::_Nodeptr _Nodeptr
Definition: list:867
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::_Unchecked_splice ( _Unchecked_const_iterator  _Where,
_Unchecked_const_iterator  _First,
_Unchecked_const_iterator  _Last 
)
inline
1865  { // splice [_First, _Last) before _Where
1866  this->_Nextnode(this->_Prevnode(_First._Mynode())) =
1867  _Last._Mynode();
1868  this->_Nextnode(this->_Prevnode(_Last._Mynode())) =
1869  _Where._Mynode();
1870  this->_Nextnode(this->_Prevnode(_Where._Mynode())) =
1871  _First._Mynode();
1872 
1873  _Nodeptr _Pnode = this->_Prevnode(_Where._Mynode());
1874  this->_Prevnode(_Where._Mynode()) =
1875  this->_Prevnode(_Last._Mynode());
1876  this->_Prevnode(_Last._Mynode()) =
1877  this->_Prevnode(_First._Mynode());
1878  this->_Prevnode(_First._Mynode()) = _Pnode;
1879  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
static _Nodepref _Prevnode(_Nodeptr _Pnode)
Definition: list:536
_Mybase::_Nodeptr _Nodeptr
Definition: list:867
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
_Nodeptr list< _Ty, _Alloc >::_Unlinknode ( const_iterator  _Where)
inline
1436  { // unlink node at _Where from the list
1437  #if _ITERATOR_DEBUG_LEVEL == 2
1438  if (_Where._Getcont() != this || _Where._Ptr == this->_Myhead)
1439  _DEBUG_ERROR("list erase iterator outside range");
1440  _Nodeptr _Pnode = (_Where)._Mynode();
1441  _Orphan_ptr(*this, _Pnode);
1442 
1443  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1444  _Nodeptr _Pnode = (_Where)._Mynode();
1445  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1446 
1447  this->_Nextnode(this->_Prevnode(_Pnode)) =
1448  this->_Nextnode(_Pnode);
1449  this->_Prevnode(this->_Nextnode(_Pnode)) =
1450  this->_Prevnode(_Pnode);
1451 
1452  --this->_Mysize;
1453  return (_Pnode);
1454  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
static _Nodepref _Prevnode(_Nodeptr _Pnode)
Definition: list:536
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_Mybase::_Nodeptr _Nodeptr
Definition: list:867
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::assign ( _XSTD initializer_list< _Ty >  _Ilist)
inline
1083  { // assign initializer_list
1084  assign(_Ilist.begin(), _Ilist.end());
1085  }
void assign(_XSTD initializer_list< _Ty > _Ilist)
Definition: list:1082
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, void>::type list< _Ty, _Alloc >::assign ( _Iter  _First,
_Iter  _Last 
)
inline
1298  { // assign [_First, _Last), input iterators
1299  iterator _Old = begin();
1300  _TRY_BEGIN
1301  for (; _First != _Last && _Old != end(); ++_First, ++_Old)
1302  _Reusenode(_Old, *_First);
1303  for (; _First != _Last; ++_First)
1304  _Insert(_Unchecked_end(), *_First);
1305  _CATCH_ALL
1306  clear();
1307  _RERAISE;
1308  _CATCH_END
1309  erase(_Old, end());
1310  }
void clear() _NOEXCEPT
Definition: list:1490
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
Definition: xutility:337
_Unchecked_iterator _Unchecked_end()
Definition: list:1146
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
iterator begin() _NOEXCEPT
Definition: list:1114
iterator end() _NOEXCEPT
Definition: list:1124
void _Reusenode(iterator _Where, _TArg &&_Arg)
Definition: list:1313
#define _CATCH_ALL
Definition: xstddef:62
iterator erase(const_iterator _Where)
Definition: list:1456
#define _RERAISE
Definition: xstddef:74
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::assign ( size_type  _Count,
const _Ty &  _Val 
)
inline
1333  { // assign _Count * _Val
1334  clear();
1336  }
void clear() _NOEXCEPT
Definition: list:1490
_Unchecked_iterator _Unchecked_begin()
Definition: list:1134
_Diff _Count
Definition: algorithm:1941
void _Insert_n(_Unchecked_const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: list:1886
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
reference list< _Ty, _Alloc >::back ( )
inline
1265  { // return last element of mutable sequence
1266  return (*(--end()));
1267  }
iterator end() _NOEXCEPT
Definition: list:1124
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reference list< _Ty, _Alloc >::back ( ) const
inline
1270  { // return last element of nonmutable sequence
1271  return (*(--end()));
1272  }
iterator end() _NOEXCEPT
Definition: list:1124
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::begin ( )
inline
1115  { // return iterator for beginning of mutable sequence
1116  return (iterator(this->_Nextnode(this->_Myhead), this));
1117  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
_Mybase::iterator iterator
Definition: list:880
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator list< _Ty, _Alloc >::begin ( ) const
inline
1120  { // return iterator for beginning of nonmutable sequence
1121  return (const_iterator(this->_Nextnode(this->_Myhead), this));
1122  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
_Mybase::const_iterator const_iterator
Definition: list:879
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator list< _Ty, _Alloc >::cbegin ( ) const
inline
1187  { // return iterator for beginning of nonmutable sequence
1188  return (((const _Myt *)this)->begin());
1189  }
list< _Ty, _Alloc > _Myt
Definition: list:864
iterator begin() _NOEXCEPT
Definition: list:1114
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator list< _Ty, _Alloc >::cend ( ) const
inline
1192  { // return iterator for end of nonmutable sequence
1193  return (((const _Myt *)this)->end());
1194  }
list< _Ty, _Alloc > _Myt
Definition: list:864
iterator end() _NOEXCEPT
Definition: list:1124
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::clear ( )
inline
1491  { // erase all
1492  #if _ITERATOR_DEBUG_LEVEL == 2
1493  this->_Orphan_ptr(*this, nullptr);
1494  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1495 
1496  _Nodeptr _Pnode = this->_Nextnode(this->_Myhead);
1497  this->_Nextnode(this->_Myhead) = this->_Myhead;
1498  this->_Prevnode(this->_Myhead) = this->_Myhead;
1499  this->_Mysize = 0;
1500 
1501  for (_Nodeptr _Pnext; _Pnode != this->_Myhead; _Pnode = _Pnext)
1502  { // delete an element
1503  _Pnext = this->_Nextnode(_Pnode);
1504  this->_Freenode(_Pnode);
1505  }
1506  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
static _Nodepref _Prevnode(_Nodeptr _Pnode)
Definition: list:536
void _Freenode(_Nodeptr _Pnode)
Definition: list:845
_Mybase::_Nodeptr _Nodeptr
Definition: list:867
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reverse_iterator list< _Ty, _Alloc >::crbegin ( ) const
inline
1197  { // return iterator for beginning of reversed nonmutable sequence
1198  return (((const _Myt *)this)->rbegin());
1199  }
list< _Ty, _Alloc > _Myt
Definition: list:864
reverse_iterator rbegin() _NOEXCEPT
Definition: list:1166
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reverse_iterator list< _Ty, _Alloc >::crend ( ) const
inline
1202  { // return iterator for end of reversed nonmutable sequence
1203  return (((const _Myt *)this)->rend());
1204  }
list< _Ty, _Alloc > _Myt
Definition: list:864
reverse_iterator rend() _NOEXCEPT
Definition: list:1176
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
iterator list< _Ty, _Alloc >::emplace ( const_iterator  _Where,
_Valty &&...  _Val 
)
inline
1045  { // insert element at _Where
1046  #if _ITERATOR_DEBUG_LEVEL == 2
1047  if (_Where._Getcont() != this)
1048  _DEBUG_ERROR("list emplace iterator outside range");
1049  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1050 
1051  _Insert(_Where._Unchecked(), _STD forward<_Valty>(_Val)...);
1052  return (_Make_iter(--_Where));
1053  }
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt const _Ty _Val
Definition: algorithm:1938
iterator _Make_iter(const_iterator _Where) const _NOEXCEPT
Definition: list:1156
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
void list< _Ty, _Alloc >::emplace_back ( _Valty &&...  _Val)
inline
1039  { // insert element at end
1040  _Insert(_Unchecked_end(), _STD forward<_Valty>(_Val)...);
1041  }
_Unchecked_iterator _Unchecked_end()
Definition: list:1146
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
void list< _Ty, _Alloc >::emplace_front ( _Valty &&...  _Val)
inline
1033  { // insert element at beginning
1034  _Insert(_Unchecked_begin(), _STD forward<_Valty>(_Val)...);
1035  }
_Unchecked_iterator _Unchecked_begin()
Definition: list:1134
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
bool list< _Ty, _Alloc >::empty ( ) const
inline
1245  { // test if sequence is empty
1246  return (this->_Mysize == 0);
1247  }
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::end ( )
inline
1125  { // return iterator for end of mutable sequence
1126  return (iterator(this->_Myhead, this));
1127  }
_Mybase::iterator iterator
Definition: list:880
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator list< _Ty, _Alloc >::end ( ) const
inline
1130  { // return iterator for end of nonmutable sequence
1131  return (const_iterator(this->_Myhead, this));
1132  }
_Mybase::const_iterator const_iterator
Definition: list:879
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::erase ( const_iterator  _Where)
inline
1457  { // erase element at _Where
1458  _Nodeptr _Pnode = _Unlinknode(_Where++);
1459  this->_Freenode(_Pnode);
1460  return (_Make_iter(_Where));
1461  }
_Nodeptr _Unlinknode(const_iterator _Where)
Definition: list:1435
void _Freenode(_Nodeptr _Pnode)
Definition: list:845
_Mybase::_Nodeptr _Nodeptr
Definition: list:867
iterator _Make_iter(const_iterator _Where) const _NOEXCEPT
Definition: list:1156
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::erase ( const_iterator  _First,
const_iterator  _Last 
)
inline
1476  { // erase [_First, _Last)
1477  if (_First == begin() && _Last == end())
1478  { // erase all and return fresh iterator
1479  clear();
1480  return (end());
1481  }
1482  else
1483  { // erase subrange
1484  while (_First != _Last)
1485  _First = erase(_First);
1486  return (_Make_iter(_Last));
1487  }
1488  }
void clear() _NOEXCEPT
Definition: list:1490
iterator begin() _NOEXCEPT
Definition: list:1114
iterator end() _NOEXCEPT
Definition: list:1124
iterator erase(const_iterator _Where)
Definition: list:1456
_FwdIt _Last
Definition: algorithm:1936
iterator _Make_iter(const_iterator _Where) const _NOEXCEPT
Definition: list:1156
template<class _Ty, class _Alloc = allocator<_Ty>>
reference list< _Ty, _Alloc >::front ( )
inline
1255  { // return first element of mutable sequence
1256  return (*begin());
1257  }
iterator begin() _NOEXCEPT
Definition: list:1114
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reference list< _Ty, _Alloc >::front ( ) const
inline
1260  { // return first element of nonmutable sequence
1261  return (*begin());
1262  }
iterator begin() _NOEXCEPT
Definition: list:1114
template<class _Ty, class _Alloc = allocator<_Ty>>
allocator_type list< _Ty, _Alloc >::get_allocator ( ) const
inline
1250  { // return allocator object for values
1251  return (this->_Getal());
1252  }
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::insert ( const_iterator  _Where,
_Ty &&  _Val 
)
inline
1027  { // insert _Val at _Where
1028  return (emplace(_Where, _STD forward<_Ty>(_Val)));
1029  }
iterator emplace(const_iterator _Where, _Valty &&..._Val)
Definition: list:1044
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::insert ( const_iterator  _Where,
_XSTD initializer_list< _Ty >  _Ilist 
)
inline
1089  { // insert initializer_list
1090  return (insert(_Where, _Ilist.begin(), _Ilist.end()));
1091  }
iterator insert(const_iterator _Where, _Ty &&_Val)
Definition: list:1026
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::insert ( const_iterator  _Where,
const _Ty &  _Val 
)
inline
1339  { // insert _Val at _Where
1340  #if _ITERATOR_DEBUG_LEVEL == 2
1341  if (_Where._Getcont() != this)
1342  _DEBUG_ERROR("list insert iterator outside range");
1343  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1344 
1345  _Insert(_Where._Unchecked(), _Val);
1346  return (_Make_iter(--_Where));
1347  }
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt const _Ty _Val
Definition: algorithm:1938
iterator _Make_iter(const_iterator _Where) const _NOEXCEPT
Definition: list:1156
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator list< _Ty, _Alloc >::insert ( const_iterator  _Where,
size_type  _Count,
const _Ty &  _Val 
)
inline
1350  { // insert _Count * _Val at _Where
1351  #if _ITERATOR_DEBUG_LEVEL == 2
1352  if (_Where._Getcont() != this)
1353  _DEBUG_ERROR("list insert iterator outside range");
1354  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1355 
1356  iterator _Prev = _Make_iter(_Where);
1357  if (_Prev == begin())
1358  { // insert sequence at beginning
1359  _Insert_n(_Where._Unchecked(), _Count, _Val);
1360  return (begin());
1361  }
1362  else
1363  { // insert sequence not at beginning
1364  --_Prev;
1365  _Insert_n(_Where._Unchecked(), _Count, _Val);
1366  return (++_Prev);
1367  }
1368  }
Definition: xutility:337
iterator begin() _NOEXCEPT
Definition: list:1114
_Diff _Count
Definition: algorithm:1941
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
void _Insert_n(_Unchecked_const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: list:1886
_FwdIt const _Ty _Val
Definition: algorithm:1938
iterator _Make_iter(const_iterator _Where) const _NOEXCEPT
Definition: list:1156
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, iterator>::type list< _Ty, _Alloc >::insert ( const_iterator  _Where,
_Iter  _First,
_Iter  _Last 
)
inline
1374  { // insert [_First, _Last) at _Where
1375  #if _ITERATOR_DEBUG_LEVEL == 2
1376  if (_Where._Getcont() != this)
1377  _DEBUG_ERROR("list insert iterator outside range");
1378  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1379 
1380  iterator _Prev = _Make_iter(_Where);
1381  if (_Prev == begin())
1382  { // insert sequence at beginning
1383  _Insert_range(_Where._Unchecked(), _First, _Last,
1384  _Iter_cat(_First));
1385  return (begin());
1386  }
1387  else
1388  { // insert sequence not at beginning
1389  --_Prev;
1390  _Insert_range(_Where._Unchecked(), _First, _Last,
1391  _Iter_cat(_First));
1392  return (++_Prev);
1393  }
1394  }
Definition: xutility:337
iterator begin() _NOEXCEPT
Definition: list:1114
iterator_traits< _Iter >::iterator_category _Iter_cat(const _Iter &)
Definition: xutility:404
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt _Last
Definition: algorithm:1936
void _Insert_range(_Unchecked_const_iterator _Where, _Iter _First, _Iter _Last, input_iterator_tag)
Definition: list:1397
iterator _Make_iter(const_iterator _Where) const _NOEXCEPT
Definition: list:1156
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type list< _Ty, _Alloc >::max_size ( ) const
inline
1240  { // return maximum possible length of sequence
1241  return (this->_Getal().max_size());
1242  }
size_type max_size() const _NOEXCEPT
Definition: list:1239
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::merge ( _Myt _Right)
inline
1665  { // merge in elements from _Right, both ordered by operator<
1666  merge(_Right, less<>());
1667  }
void merge(_Myt &_Right)
Definition: list:1664
Definition: xstddef:188
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::merge ( _Myt &&  _Right)
inline
1670  { // merge in elements from _Right, both ordered by operator<
1671  merge((_Myt&)_Right);
1672  }
list< _Ty, _Alloc > _Myt
Definition: list:864
void merge(_Myt &_Right)
Definition: list:1664
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void list< _Ty, _Alloc >::merge ( _Myt _Right,
_Pr2  _Pred 
)
inline
1676  { // merge in elements from _Right, both ordered by _Pred
1677  if (&_Right != this)
1678  { // safe to merge, do it
1679  iterator _First1 = begin(), _Last1 = end();
1680  iterator _First2 = _Right.begin(), _Last2 = _Right.end();
1681  _DEBUG_ORDER_PRED(_First1, _Last1, _Pred);
1682  _DEBUG_ORDER_PRED(_First2, _Last2, _Pred);
1683 
1684  while (_First1 != _Last1 && _First2 != _Last2)
1685  if (_DEBUG_LT_PRED(_Pred, *_First2, *_First1))
1686  { // splice in an element from _Right
1687  iterator _Mid2 = _First2;
1688  _Splice(_First1, _Right, _First2, ++_Mid2, 1);
1689  _First2 = _Mid2;
1690  }
1691  else
1692  ++_First1;
1693 
1694  if (_First2 != _Last2)
1695  _Splice(_Last1, _Right, _First2, _Last2,
1696  _Right._Mysize); // splice remainder of _Right
1697  }
1698  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:462
Definition: xutility:337
iterator begin() _NOEXCEPT
Definition: list:1114
iterator end() _NOEXCEPT
Definition: list:1124
#define _DEBUG_ORDER_PRED(first, last, pred)
Definition: xutility:464
void _Splice(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last, size_type _Count)
Definition: list:1770
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void list< _Ty, _Alloc >::merge ( _Myt &&  _Right,
_Pr2  _Pred 
)
inline
1702  { // merge in elements from _Right, both ordered by _Pred
1703  merge((_Myt&)_Right, _Pred);
1704  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
list< _Ty, _Alloc > _Myt
Definition: list:864
void merge(_Myt &_Right)
Definition: list:1664
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& list< _Ty, _Alloc >::operator= ( _Myt &&  _Right)
inline
995  { // assign by moving _Right
996  if (this != &_Right)
997  { // different, assign it
998  clear();
999 
1000  if (_Alty::propagate_on_container_move_assignment::value
1001  && this->_Getal() != _Right._Getal())
1002  this->_Change_alloc(_Right._Getal());
1003 
1004  _Assign_rv(_STD forward<_Myt>(_Right));
1005  }
1006  return (*this);
1007  }
void clear() _NOEXCEPT
Definition: list:1490
void _Assign_rv(_Myt &&_Right)
Definition: list:1009
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& list< _Ty, _Alloc >::operator= ( _XSTD initializer_list< _Ty >  _Ilist)
inline
1077  { // assign initializer_list
1078  assign(_Ilist.begin(), _Ilist.end());
1079  return (*this);
1080  }
void assign(_XSTD initializer_list< _Ty > _Ilist)
Definition: list:1082
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& list< _Ty, _Alloc >::operator= ( const _Myt _Right)
inline
1099  { // assign _Right
1100  if (this != &_Right)
1101  { // different, assign it
1102  if (this->_Getal() != _Right._Getal()
1103  && _Alty::propagate_on_container_copy_assignment::value)
1104  { // change allocator before copying
1105  clear();
1106  this->_Change_alloc(_Right._Getal());
1107  }
1108 
1109  assign(_Right.begin(), _Right.end());
1110  }
1111  return (*this);
1112  }
void clear() _NOEXCEPT
Definition: list:1490
void assign(_XSTD initializer_list< _Ty > _Ilist)
Definition: list:1082
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::pop_back ( )
inline
1290  { // erase element at end
1291  erase(--end());
1292  }
iterator end() _NOEXCEPT
Definition: list:1124
iterator erase(const_iterator _Where)
Definition: list:1456
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::pop_front ( )
inline
1280  { // erase element at beginning
1281  erase(begin());
1282  }
iterator begin() _NOEXCEPT
Definition: list:1114
iterator erase(const_iterator _Where)
Definition: list:1456
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::push_back ( _Ty &&  _Val)
inline
1022  { // insert element at end
1023  _Insert(_Unchecked_end(), _STD forward<_Ty>(_Val));
1024  }
_Unchecked_iterator _Unchecked_end()
Definition: list:1146
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::push_back ( const _Ty &  _Val)
inline
1285  { // insert element at end
1287  }
_Unchecked_iterator _Unchecked_end()
Definition: list:1146
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::push_front ( _Ty &&  _Val)
inline
1017  { // insert element at beginning
1018  _Insert(_Unchecked_begin(), _STD forward<_Ty>(_Val));
1019  }
_Unchecked_iterator _Unchecked_begin()
Definition: list:1134
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::push_front ( const _Ty &  _Val)
inline
1275  { // insert element at beginning
1277  }
_Unchecked_iterator _Unchecked_begin()
Definition: list:1134
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
reverse_iterator list< _Ty, _Alloc >::rbegin ( )
inline
1167  { // return iterator for beginning of reversed mutable sequence
1168  return (reverse_iterator(end()));
1169  }
iterator end() _NOEXCEPT
Definition: list:1124
_STD reverse_iterator< iterator > reverse_iterator
Definition: list:886
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reverse_iterator list< _Ty, _Alloc >::rbegin ( ) const
inline
1172  { // return iterator for beginning of reversed nonmutable sequence
1173  return (const_reverse_iterator(end()));
1174  }
iterator end() _NOEXCEPT
Definition: list:1124
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: list:887
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::remove ( const _Ty &  _Val)
inline
1607  { // erase each element matching _Val
1608  iterator _Val_it = end();
1609 
1610  for (iterator _First = begin(); _First != end(); )
1611  if (*_First == _Val)
1612  if (_STD addressof(*_First) == _STD addressof(_Val))
1613  _Val_it = _First++;
1614  else
1615  _First = erase(_First);
1616  else
1617  ++_First;
1618 
1619  if (_Val_it != end())
1620  erase(_Val_it);
1621  }
Definition: xutility:337
iterator begin() _NOEXCEPT
Definition: list:1114
iterator end() _NOEXCEPT
Definition: list:1124
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
iterator erase(const_iterator _Where)
Definition: list:1456
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr1 >
void list< _Ty, _Alloc >::remove_if ( _Pr1  _Pred)
inline
1625  { // erase each element satisfying _Pred
1626  for (iterator _First = begin(); _First != end(); )
1627  if (_Pred(*_First))
1628  _First = erase(_First);
1629  else
1630  ++_First;
1631  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
Definition: xutility:337
iterator begin() _NOEXCEPT
Definition: list:1114
iterator end() _NOEXCEPT
Definition: list:1124
iterator erase(const_iterator _Where)
Definition: list:1456
template<class _Ty, class _Alloc = allocator<_Ty>>
reverse_iterator list< _Ty, _Alloc >::rend ( )
inline
1177  { // return iterator for end of reversed mutable sequence
1178  return (reverse_iterator(begin()));
1179  }
iterator begin() _NOEXCEPT
Definition: list:1114
_STD reverse_iterator< iterator > reverse_iterator
Definition: list:886
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reverse_iterator list< _Ty, _Alloc >::rend ( ) const
inline
1182  { // return iterator for end of reversed nonmutable sequence
1183  return (const_reverse_iterator(begin()));
1184  }
iterator begin() _NOEXCEPT
Definition: list:1114
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: list:887
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::resize ( size_type  _Newsize)
inline
1207  { // determine new length, padding with _Ty() elements as needed
1208  if (this->_Mysize < _Newsize)
1209  { // pad to make larger
1210  size_type _Count = 0;
1211  _TRY_BEGIN
1212  for (; this->_Mysize < _Newsize; ++_Count)
1214  _CATCH_ALL
1215  for (; 0 < _Count; --_Count)
1216  pop_back(); // undo inserts
1217  _RERAISE;
1218  _CATCH_END
1219  }
1220  else
1221  while (_Newsize < this->_Mysize)
1222  pop_back();
1223  }
void pop_back()
Definition: list:1289
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
_Unchecked_iterator _Unchecked_end()
Definition: list:1146
_Mybase::size_type size_type
Definition: list:871
void _Insert(_Unchecked_const_iterator _Where, _Valty &&..._Val)
Definition: list:1056
#define _CATCH_ALL
Definition: xstddef:62
_Diff _Count
Definition: algorithm:1941
#define _RERAISE
Definition: xstddef:74
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::resize ( size_type  _Newsize,
const _Ty &  _Val 
)
inline
1226  { // determine new length, padding with _Val elements as needed
1227  if (this->_Mysize < _Newsize)
1228  _Insert_n(_Unchecked_end(), _Newsize - this->_Mysize, _Val);
1229  else
1230  while (_Newsize < this->_Mysize)
1231  pop_back();
1232  }
void pop_back()
Definition: list:1289
_Unchecked_iterator _Unchecked_end()
Definition: list:1146
void _Insert_n(_Unchecked_const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: list:1886
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::reverse ( )
inline
1754  { // reverse sequence
1755  const _Nodeptr _Phead = this->_Myhead;
1756  _Nodeptr _Pnode = _Phead;
1757 
1758  for (; ; )
1759  { // flip pointers in a node
1760  const _Nodeptr _Pnext = this->_Nextnode(_Pnode);
1761  this->_Nextnode(_Pnode) = this->_Prevnode(_Pnode);
1762  this->_Prevnode(_Pnode) = _Pnext;
1763 
1764  if (_Pnext == _Phead)
1765  break;
1766  _Pnode = _Pnext;
1767  }
1768  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
static _Nodepref _Prevnode(_Nodeptr _Pnode)
Definition: list:536
_Mybase::_Nodeptr _Nodeptr
Definition: list:867
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type list< _Ty, _Alloc >::size ( ) const
inline
1235  { // return length of sequence
1236  return (this->_Mysize);
1237  }
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::sort ( )
inline
1707  { // order sequence, using operator<
1708  sort(less<>());
1709  }
void sort()
Definition: list:1706
Definition: xstddef:188
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void list< _Ty, _Alloc >::sort ( _Pr2  _Pred)
inline
1713  { // order sequence, using _Pred
1714  if (2 <= this->_Mysize)
1715  { // worth sorting, do it
1716  const size_t _MAXBINS = 25;
1717  _Myt _Templist(this->_Getal()), _Binlist[_MAXBINS + 1];
1718  size_t _Maxbin = 0;
1719 
1720  while (!empty())
1721  { // sort another element, using bins
1722  _Templist._Splice_same(_Templist.begin(), *this, begin(),
1723  ++begin(), 1);
1724 
1725  size_t _Bin;
1726  for (_Bin = 0; _Bin < _Maxbin && !_Binlist[_Bin].empty();
1727  ++_Bin)
1728  { // merge into ever larger bins
1729  _Binlist[_Bin].merge(_Templist, _Pred);
1730  _Binlist[_Bin].swap(_Templist);
1731  }
1732 
1733  if (_Bin == _MAXBINS)
1734  _Binlist[_Bin - 1].merge(_Templist, _Pred);
1735  else
1736  { // spill to new bin, while they last
1737  _Binlist[_Bin].swap(_Templist);
1738  if (_Bin == _Maxbin)
1739  ++_Maxbin;
1740  }
1741  }
1742 
1743  for (size_t _Bin = 1; _Bin < _Maxbin; ++_Bin)
1744  _Binlist[_Bin].merge(_Binlist[_Bin - 1],
1745  _Pred); // merge up
1746 
1747  _Analysis_assume_(0 < _Maxbin);
1748 
1749  splice(begin(), _Binlist[_Maxbin - 1]); // result in last bin
1750  }
1751  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
bool empty() const _NOEXCEPT
Definition: list:1244
list< _Ty, _Alloc > _Myt
Definition: list:864
iterator begin() _NOEXCEPT
Definition: list:1114
void merge(_Myt &_Right)
Definition: list:1664
#define _Analysis_assume_(expr)
Definition: sal.h:2916
void splice(const_iterator _Where, _Myt &_Right)
Definition: list:1536
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::splice ( const_iterator  _Where,
_Myt _Right 
)
inline
1537  { // splice all of _Right at _Where
1538  if (this != &_Right && !_Right.empty())
1539  { // worth splicing, do it
1540  _Splice(_Where, _Right, _Right.begin(), _Right.end(),
1541  _Right._Mysize);
1542  }
1543  }
void _Splice(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last, size_type _Count)
Definition: list:1770
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::splice ( const_iterator  _Where,
_Myt &&  _Right 
)
inline
1546  { // splice all of _Right at _Where
1547  splice(_Where, (_Myt&)_Right);
1548  }
list< _Ty, _Alloc > _Myt
Definition: list:864
void splice(const_iterator _Where, _Myt &_Right)
Definition: list:1536
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::splice ( const_iterator  _Where,
_Myt _Right,
const_iterator  _First 
)
inline
1552  { // splice _Right [_First, _First + 1) at _Where
1553  #if _ITERATOR_DEBUG_LEVEL == 2
1554  if (_First == _Right.end())
1555  _DEBUG_ERROR("list splice iterator outside range");
1556  else
1557 
1558  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1559  if (_First != _Right.end())
1560  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1561 
1562  { // element exists, try splice
1563  const_iterator _Last = _First;
1564  ++_Last;
1565  if (this != &_Right
1566  || (_Where != _First && _Where != _Last))
1567  _Splice(_Where, _Right, _First, _Last, 1);
1568  }
1569  }
_Mybase::const_iterator const_iterator
Definition: list:879
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
void _Splice(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last, size_type _Count)
Definition: list:1770
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::splice ( const_iterator  _Where,
_Myt &&  _Right,
const_iterator  _First 
)
inline
1573  { // splice _Right [_First, _First + 1) at _Where
1574  splice(_Where, (_Myt&)_Right, _First);
1575  }
list< _Ty, _Alloc > _Myt
Definition: list:864
void splice(const_iterator _Where, _Myt &_Right)
Definition: list:1536
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::splice ( const_iterator  _Where,
_Myt _Right,
const_iterator  _First,
const_iterator  _Last 
)
inline
1579  { // splice _Right [_First, _Last) at _Where
1580  if (_First != _Last && (this != &_Right || _Where != _Last))
1581  { // worth splicing, do it
1582  size_type _Count = 0;
1583 
1584  if (this == &_Right)
1585  ; // just rearrange this list
1586  else if (_First == _Right.begin() && _Last == _Right.end())
1587  _Count = _Right._Mysize; // splice in whole list
1588  else
1589  { // count nodes and check for knot
1590  const_iterator _Next = _First;
1591 
1592  for (; _Next != _Last; ++_Next, ++_Count)
1593  if (_Next == _Right.end())
1594  _Xlength_error("list<T> bad splice");
1595  }
1596  _Splice(_Where, _Right, _First, _Last, _Count);
1597  }
1598  }
_Mybase::size_type size_type
Definition: list:871
_Mybase::const_iterator const_iterator
Definition: list:879
for(;0< _Count;)
Definition: algorithm:1944
_Diff _Count
Definition: algorithm:1941
void _Splice(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last, size_type _Count)
Definition: list:1770
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::splice ( const_iterator  _Where,
_Myt &&  _Right,
const_iterator  _First,
const_iterator  _Last 
)
inline
1602  { // splice _Right [_First, _Last) at _Where
1603  splice(_Where, (_Myt&)_Right, _First, _Last);
1604  }
list< _Ty, _Alloc > _Myt
Definition: list:864
void splice(const_iterator _Where, _Myt &_Right)
Definition: list:1536
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::swap ( _Myt _Right)
inline
1509  { // exchange contents with _Right
1510  if (this == &_Right)
1511  ; // same object, do nothing
1512  else if (this->_Getal() == _Right._Getal())
1513  { // same allocator, swap control information
1514  this->_Swap_all(_Right);
1515  _Swap_adl(this->_Myhead, _Right._Myhead);
1516  _STD swap(this->_Mysize, _Right._Mysize);
1517  }
1518 
1519  else if (_Alty::propagate_on_container_swap::value)
1520  { // swap allocators and control information
1521  this->_Swap_alloc(_Right);
1522  _Swap_adl(this->_Myhead, _Right._Myhead);
1523  _STD swap(this->_Mysize, _Right._Mysize);
1524  }
1525 
1526  else // containers are incompatible
1527 
1528  #if _ITERATOR_DEBUG_LEVEL == 2
1529  _DEBUG_ERROR("list containers incompatible for swap");
1530 
1531  #else /* ITERATOR_DEBUG_LEVEL == 2 */
1532  _XSTD terminate();
1533  #endif /* ITERATOR_DEBUG_LEVEL == 2 */
1534  }
void swap(_Myt &_Right)
Definition: list:1508
void __CRTDECL terminate()
Definition: exception:303
void _Swap_all(_Container_base0 &)
Definition: xutility:46
#define _XSTD
Definition: xstddef:20
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void list< _Ty, _Alloc >::unique ( )
inline
1634  { // erase each element matching previous
1635  unique(equal_to<>());
1636  }
Definition: xstddef:177
void unique()
Definition: list:1633
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void list< _Ty, _Alloc >::unique ( _Pr2  _Pred)
inline
1640  { // erase each element satisfying _Pred with previous
1641  const _Nodeptr _Phead = this->_Myhead;
1642  _Nodeptr _Pprev = this->_Nextnode(_Phead);
1643  _Nodeptr _Pnode = this->_Nextnode(_Pprev);
1644 
1645  while (_Pnode != _Phead)
1646  if (_Pred(_Pprev->_Myval, _Pnode->_Myval))
1647  { // match, remove it
1648  const _Nodeptr _Perase = _Pnode;
1649  _Pnode = this->_Nextnode(_Pnode);
1650 
1651  this->_Nextnode(_Pprev) = _Pnode;
1652  this->_Prevnode(_Pnode) = _Pprev;
1653  this->_Freenode(_Perase);
1654 
1655  --this->_Mysize;
1656  }
1657  else
1658  { // no match, advance
1659  _Pprev = _Pnode;
1660  _Pnode = this->_Nextnode(_Pnode);
1661  }
1662  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: list:531
static _Nodepref _Prevnode(_Nodeptr _Pnode)
Definition: list:536
void _Freenode(_Nodeptr _Pnode)
Definition: list:845
_Mybase::_Nodeptr _Nodeptr
Definition: list:867

The documentation for this class was generated from the following file: