STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Private Member Functions | List of all members
forward_list< _Ty, _Alloc > Class Template Reference
Inheritance diagram for forward_list< _Ty, _Alloc >:
_Flist_buy< _Ty, _Alloc > _Flist_alloc<!is_empty< _Alloc >::value, _Flist_base_types< _Ty, _Alloc > > _Flist_val< _Flist_base_types< _Ty, _Alloc >::_Val_types > _Container_base0

Public Types

typedef forward_list< _Ty, _Alloc_Myt
 
typedef _Flist_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
 
- Public Types inherited from _Flist_buy< _Ty, _Alloc >
typedef _Flist_alloc<!is_empty< _Alloc >::value, _Flist_base_types< _Ty, _Alloc > > _Mybase
 
typedef _Mybase::_Alty _Alty
 
typedef _Mybase::_Nodeptr _Nodeptr
 
- Public Types inherited from _Flist_alloc<!is_empty< _Alloc >::value, _Flist_base_types< _Ty, _Alloc > >
typedef _Flist_alloc< _Al_has_storage, _Flist_base_types< _Ty, _Alloc > > _Myt
 
typedef _Flist_val< typename _Flist_base_types< _Ty, _Alloc >::_Val_types > _Mybase
 
typedef _Flist_base_types< _Ty, _Alloc >::_Alloc _Alloc
 
typedef _Flist_base_types< _Ty, _Alloc >::_Alnod_type _Alty
 
typedef _Flist_base_types< _Ty, _Alloc >::_Node _Node
 
typedef _Flist_base_types< _Ty, _Alloc >::_Nodeptr _Nodeptr
 
- Public Types inherited from _Flist_val< _Flist_base_types< _Ty, _Alloc >::_Val_types >
typedef _Flist_val< _Flist_base_types< _Ty, _Alloc >::_Val_types > _Myt
 
typedef _Flist_base_types< _Ty, _Alloc >::_Val_types::_Nodeptr _Nodeptr
 
typedef _Nodeptr_Nodepref
 
typedef _Flist_base_types< _Ty, _Alloc >::_Val_types::value_type value_type
 
typedef _Flist_base_types< _Ty, _Alloc >::_Val_types::size_type size_type
 
typedef _Flist_base_types< _Ty, _Alloc >::_Val_types::difference_type difference_type
 
typedef _Flist_base_types< _Ty, _Alloc >::_Val_types::pointer pointer
 
typedef _Flist_base_types< _Ty, _Alloc >::_Val_types::const_pointer const_pointer
 
typedef _Flist_base_types< _Ty, _Alloc >::_Val_types::reference reference
 
typedef _Flist_base_types< _Ty, _Alloc >::_Val_types::const_reference const_reference
 
typedef _Flist_const_iterator< _Mytconst_iterator
 
typedef _Flist_iterator< _Mytiterator
 

Public Member Functions

 forward_list ()
 
 forward_list (size_type _Count)
 
 forward_list (size_type _Count, const _Ty &_Val)
 
 forward_list (size_type _Count, const _Ty &_Val, const _Alloc &_Al)
 
 forward_list (const _Alloc &_Al)
 
 forward_list (const _Myt &_Right)
 
 forward_list (const _Myt &_Right, const _Alloc &_Al)
 
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>::type>
 forward_list (_Iter _First, _Iter _Last)
 
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>::type>
 forward_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)
 
 forward_list (_Myt &&_Right)
 
 forward_list (_Myt &&_Right, const _Alloc &_Al)
 
_Mytoperator= (_Myt &&_Right)
 
void _Assign_rv (_Myt &&_Right)
 
void push_front (_Ty &&_Val)
 
iterator insert_after (const_iterator _Where, _Ty &&_Val)
 
template<class... _Valty>
void emplace_front (_Valty &&..._Val)
 
template<class... _Valty>
iterator emplace_after (const_iterator _Where, _Valty &&..._Val)
 
template<class... _Valty>
void _Insert_after (const_iterator _Where, _Valty &&..._Val)
 
 forward_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_after (const_iterator _Where, _XSTD initializer_list< _Ty > _Ilist)
 
 ~forward_list () _NOEXCEPT
 
_Mytoperator= (const _Myt &_Right)
 
iterator before_begin () _NOEXCEPT
 
const_iterator before_begin () const _NOEXCEPT
 
const_iterator cbefore_begin () const _NOEXCEPT
 
iterator begin () _NOEXCEPT
 
const_iterator begin () const _NOEXCEPT
 
iterator end () _NOEXCEPT
 
const_iterator end () const _NOEXCEPT
 
iterator _Make_iter (const_iterator _Where) const
 
const_iterator cbegin () const _NOEXCEPT
 
const_iterator cend () const _NOEXCEPT
 
void resize (size_type _Newsize)
 
void resize (size_type _Newsize, const _Ty &_Val)
 
size_type max_size () const _NOEXCEPT
 
bool empty () const _NOEXCEPT
 
allocator_type get_allocator () const _NOEXCEPT
 
reference front ()
 
const_reference front () const
 
void push_front (const _Ty &_Val)
 
void pop_front ()
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, void >::type assign (_Iter _First, _Iter _Last)
 
void assign (size_type _Count, const _Ty &_Val)
 
iterator insert_after (const_iterator _Where, const _Ty &_Val)
 
iterator insert_after (const_iterator _Where, size_type _Count, const _Ty &_Val)
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, iterator >::type insert_after (const_iterator _Where, _Iter _First, _Iter _Last)
 
template<class _Iter >
iterator _Insert_range (const_iterator _Where, _Iter _First, _Iter _Last, input_iterator_tag)
 
template<class _Iter >
iterator _Insert_range (const_iterator _Where, _Iter _First, _Iter _Last, forward_iterator_tag)
 
iterator erase_after (const_iterator _Where)
 
iterator erase_after (const_iterator _First, const_iterator _Last)
 
void clear () _NOEXCEPT
 
void swap (_Myt &_Right)
 
void splice_after (const_iterator _Where, _Myt &_Right)
 
void splice_after (const_iterator _Where, _Myt &&_Right)
 
void splice_after (const_iterator _Where, _Myt &_Right, const_iterator _First)
 
void splice_after (const_iterator _Where, _Myt &&_Right, const_iterator _First)
 
void splice_after (const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
 
void splice_after (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
 
- Public Member Functions inherited from _Flist_buy< _Ty, _Alloc >
 _Flist_buy (_Alloc _Al=_Alloc())
 
_Nodeptr _Buynode0 (_Nodeptr _Next)
 
template<class... _Valty>
_Nodeptr _Buynode (_Nodeptr _Next, _Valty &&..._Val)
 
void _Freenode (_Nodeptr _Pnode)
 
- Public Member Functions inherited from _Flist_alloc<!is_empty< _Alloc >::value, _Flist_base_types< _Ty, _Alloc > >
 _Flist_alloc (_Alloc _Al=_Alloc())
 
 ~_Flist_alloc () _NOEXCEPT
 
void _Change_alloc (const _Alty &_Al)
 
void _Swap_alloc (_Myt &_Right)
 
_Alty_Getal ()
 
const _Alty_Getal () const
 
- Public Member Functions inherited from _Flist_val< _Flist_base_types< _Ty, _Alloc >::_Val_types >
 _Flist_val ()
 
- Public Member Functions inherited from _Container_base0
void _Orphan_all ()
 
void _Swap_all (_Container_base0 &)
 

Private Member Functions

size_type _Size () const
 
const_iterator _Before_end () const
 
void _Splice_after (const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
 
void _Splice_same_after (const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
 
void _Tidy ()
 
iterator _Insert_n_after (const_iterator _Where, size_type _Count, const _Ty &_Val)
 

Additional Inherited Members

- Static Public Member Functions inherited from _Flist_val< _Flist_base_types< _Ty, _Alloc >::_Val_types >
static _Nodepref _Nextnode (_Nodeptr _Pnode)
 
static reference _Myval (_Nodeptr _Pnode)
 
- Public Attributes inherited from _Flist_alloc<!is_empty< _Alloc >::value, _Flist_base_types< _Ty, _Alloc > >
_Alty _Alnod
 
- Public Attributes inherited from _Flist_val< _Flist_base_types< _Ty, _Alloc >::_Val_types >
_Nodeptr _Myhead
 

Member Typedef Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::_Alty forward_list< _Ty, _Alloc >::_Alty
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Flist_buy<_Ty, _Alloc> forward_list< _Ty, _Alloc >::_Mybase
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef forward_list<_Ty, _Alloc> forward_list< _Ty, _Alloc >::_Myt
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::_Node forward_list< _Ty, _Alloc >::_Node
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::_Nodeptr forward_list< _Ty, _Alloc >::_Nodeptr
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Alloc forward_list< _Ty, _Alloc >::allocator_type
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::const_iterator forward_list< _Ty, _Alloc >::const_iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::const_pointer forward_list< _Ty, _Alloc >::const_pointer
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::const_reference forward_list< _Ty, _Alloc >::const_reference
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::difference_type forward_list< _Ty, _Alloc >::difference_type
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::iterator forward_list< _Ty, _Alloc >::iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::pointer forward_list< _Ty, _Alloc >::pointer
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::reference forward_list< _Ty, _Alloc >::reference
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::size_type forward_list< _Ty, _Alloc >::size_type
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::value_type forward_list< _Ty, _Alloc >::value_type

Constructor & Destructor Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( )
inline
721  : _Mybase()
722  { // construct empty list
723  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( size_type  _Count)
inlineexplicit
726  : _Mybase()
727  { // construct list from _Count * _Ty()
728  resize(_Count);
729  }
void resize(size_type _Newsize)
Definition: forward_list:981
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
_Diff _Count
Definition: algorithm:1941
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( size_type  _Count,
const _Ty &  _Val 
)
inline
732  : _Mybase()
733  { // construct list from _Count * _Val
735  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
void _Construct_n(size_type _Count, const _Ty &_Val)
Definition: forward_list:802
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( size_type  _Count,
const _Ty &  _Val,
const _Alloc _Al 
)
inline
738  : _Mybase(_Al)
739  { // construct list from _Count * _Val, allocator
741  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
void _Construct_n(size_type _Count, const _Ty &_Val)
Definition: forward_list:802
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( const _Alloc _Al)
inlineexplicit
744  : _Mybase(_Al)
745  { // construct empty list, allocator
746  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( const _Myt _Right)
inline
750  : _Mybase(_Right._Getal().select_on_container_copy_construction())
751 
752 
753  { // construct list by copying _Right
754  _TRY_BEGIN
755  insert_after(before_begin(), _Right.begin(), _Right.end());
756  _CATCH_ALL
757  _Tidy();
758  _RERAISE;
759  _CATCH_END
760  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:851
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
#define _CATCH_ALL
Definition: xstddef:62
void _Tidy()
Definition: forward_list:1504
#define _RERAISE
Definition: xstddef:74
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( const _Myt _Right,
const _Alloc _Al 
)
inline
763  : _Mybase(_Al)
764  { // construct list by copying _Right, allocator
765  _TRY_BEGIN
766  insert_after(before_begin(), _Right.begin(), _Right.end());
767  _CATCH_ALL
768  _Tidy();
769  _RERAISE;
770  _CATCH_END
771  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:851
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
#define _CATCH_ALL
Definition: xstddef:62
void _Tidy()
Definition: forward_list:1504
#define _RERAISE
Definition: xstddef:74
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>
forward_list< _Ty, _Alloc >::forward_list ( _Iter  _First,
_Iter  _Last 
)
inline
777  : _Mybase()
778  { // construct list from [_First, _Last,
779  _Construct(_First, _Last);
780  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
void _Construct(_Iter _First, _Iter _Last)
Definition: forward_list:792
_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>
forward_list< _Ty, _Alloc >::forward_list ( _Iter  _First,
_Iter  _Last,
const _Alloc _Al 
)
inline
786  : _Mybase(_Al)
787  { // construct list, allocator from [_First, _Last)
788  _Construct(_First, _Last);
789  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
void _Construct(_Iter _First, _Iter _Last)
Definition: forward_list:792
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( _Myt &&  _Right)
inline
814  : _Mybase(_Right._Getal())
815  { // construct list by moving _Right
816  _Assign_rv(_STD forward<_Myt>(_Right));
817  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
void _Assign_rv(_Myt &&_Right)
Definition: forward_list:840
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( _Myt &&  _Right,
const _Alloc _Al 
)
inline
820  : _Mybase(_Al)
821  { // construct list by moving _Right, allocator
822  _Assign_rv(_STD forward<_Myt>(_Right));
823  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
void _Assign_rv(_Myt &&_Right)
Definition: forward_list:840
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( _XSTD initializer_list< _Ty >  _Ilist,
const _Alloc _Al = allocator_type() 
)
inline
888  : _Mybase(_Al)
889  { // construct from initializer_list
890  insert_after(before_begin(), _Ilist.begin(), _Ilist.end());
891  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:851
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:703
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::~forward_list ( )
inline
911  { // destroy the object
912  _Tidy();
913  }
void _Tidy()
Definition: forward_list:1504

Member Function Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::_Assign_rv ( _Myt &&  _Right)
inline
841  { // swap with empty *this, same allocator
842  this->_Swap_all(_Right);
843  _Swap_adl(this->_Myhead, _Right._Myhead);
844  }
void _Swap_all(_Container_base0 &)
Definition: xutility:46
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::_Before_end ( ) const
inlineprivate
1450  { // get iterator just before end
1451  const_iterator _Next = before_begin();
1452  for (const_iterator _Nextp = _Next; ++_Nextp != end(); )
1453  _Next = _Nextp;
1454  return (_Next);
1455  }
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
iterator end() _NOEXCEPT
Definition: forward_list:956
_Mybase::const_iterator const_iterator
Definition: forward_list:717
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void forward_list< _Ty, _Alloc >::_Construct ( _Iter  _First,
_Iter  _Last 
)
inline
793  { // construct list from [_First, _Last), input iterators
794  _TRY_BEGIN
795  insert_after(before_begin(), _First, _Last);
796  _CATCH_ALL
797  _Tidy();
798  _RERAISE;
799  _CATCH_END
800  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:851
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
#define _CATCH_ALL
Definition: xstddef:62
void _Tidy()
Definition: forward_list:1504
#define _RERAISE
Definition: xstddef:74
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::_Construct_n ( size_type  _Count,
const _Ty &  _Val 
)
inline
804  { // construct from _Count * _Val
805  _TRY_BEGIN
807  _CATCH_ALL
808  _Tidy();
809  _RERAISE;
810  _CATCH_END
811  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
#define _CATCH_ALL
Definition: xstddef:62
void _Tidy()
Definition: forward_list:1504
_Diff _Count
Definition: algorithm:1941
#define _RERAISE
Definition: xstddef:74
iterator _Insert_n_after(const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: forward_list:1509
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
void forward_list< _Ty, _Alloc >::_Insert_after ( const_iterator  _Where,
_Valty &&...  _Val 
)
inline
872  { // insert element after _Where
873  #if _ITERATOR_DEBUG_LEVEL == 2
874  if (_Where._Getcont() != this)
875  _DEBUG_ERROR("forward_list insert_after iterator outside range");
876  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
877 
878  _Nodeptr _Pnode = _Where._Mynode();
879  _Nodeptr _Newnode =
880  this->_Buynode(this->_Nextnode(_Pnode),
881  _STD forward<_Valty>(_Val)...);
882  this->_Nextnode(_Pnode) = _Newnode;
883  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: forward_list:452
_Mybase::_Nodeptr _Nodeptr
Definition: forward_list:705
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt const _Ty _Val
Definition: algorithm:1938
_Nodeptr _Buynode(_Nodeptr _Next, _Valty &&..._Val)
Definition: forward_list:667
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::_Insert_n_after ( const_iterator  _Where,
size_type  _Count,
const _Ty &  _Val 
)
inlineprivate
1511  { // insert _Count * _Val after _Where
1512  size_type _Countsave = _Count;
1513 
1514  _TRY_BEGIN
1515  for (; 0 < _Count; --_Count, ++_Where)
1516  _Insert_after(_Where, _Val);
1517  _CATCH_ALL
1518  for (; _Count < _Countsave; ++_Count)
1519  erase_after(_Where);
1520  _RERAISE;
1521  _CATCH_END
1522  return (_Make_iter(_Where));
1523  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:966
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:870
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: forward_list:709
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126
_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 >
iterator forward_list< _Ty, _Alloc >::_Insert_range ( const_iterator  _Where,
_Iter  _First,
_Iter  _Last,
input_iterator_tag   
)
inline
1092  { // insert [_First, _Last) after _Where, input iterators
1093  size_type _Num = 0;
1094  const_iterator _After = _Where;
1095 
1096  _TRY_BEGIN
1097  for (; _First != _Last; ++_After, ++_First, ++_Num)
1098  _Insert_after(_After, *_First);
1099  _CATCH_ALL
1100  for (; 0 < _Num; --_Num)
1101  erase_after(_Where);
1102  _RERAISE;
1103  _CATCH_END
1104  return (_Make_iter(_After));
1105  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:966
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:870
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: forward_list:709
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126
_Mybase::const_iterator const_iterator
Definition: forward_list:717
#define _RERAISE
Definition: xstddef:74
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
iterator forward_list< _Ty, _Alloc >::_Insert_range ( const_iterator  _Where,
_Iter  _First,
_Iter  _Last,
forward_iterator_tag   
)
inline
1110  { // insert [_First, _Last) after _Where, forward iterators
1111  _DEBUG_RANGE(_First, _Last);
1112  _Iter _Next = _First;
1113  const_iterator _After = _Where;
1114 
1115  _TRY_BEGIN
1116  for (; _First != _Last; ++_After, ++_First)
1117  _Insert_after(_After, *_First);
1118  _CATCH_ALL
1119  for (; _Next != _First; ++_Next)
1120  erase_after(_Where);
1121  _RERAISE;
1122  _CATCH_END
1123  return (_Make_iter(_After));
1124  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:966
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:870
#define _CATCH_ALL
Definition: xstddef:62
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126
_Mybase::const_iterator const_iterator
Definition: forward_list:717
#define _RERAISE
Definition: xstddef:74
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::_Make_iter ( const_iterator  _Where) const
inline
967  { // make iterator from const_iterator
968  return (iterator(_Where._Ptr, this));
969  }
_Mybase::iterator iterator
Definition: forward_list:718
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type forward_list< _Ty, _Alloc >::_Size ( ) const
inlineprivate
1442  { // get size by counting
1443  size_type _Ans = 0;
1444  for (const_iterator _Next = begin(); _Next != end(); ++_Next)
1445  ++_Ans;
1446  return (_Ans);
1447  }
iterator begin() _NOEXCEPT
Definition: forward_list:946
iterator end() _NOEXCEPT
Definition: forward_list:956
_Mybase::size_type size_type
Definition: forward_list:709
_Mybase::const_iterator const_iterator
Definition: forward_list:717
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::_Splice_after ( const_iterator  _Where,
_Myt _Right,
const_iterator  _First,
const_iterator  _Last 
)
inlineprivate
1459  { // splice _Right (_First, _Last) just after _Where
1460  #if _ITERATOR_DEBUG_LEVEL == 2
1461  if (_Where._Getcont() != this || _Where == end())
1462  _DEBUG_ERROR("forward_list splice_after iterator outside range");
1463  if (this->_Getal() != _Right._Getal())
1464  _DEBUG_ERROR("forward_list containers incompatible for splice_after");
1465 
1466  if (this != &_Right)
1467  { // transfer ownership of (_First, _Last)
1468  const_iterator _Next = _First;
1469  for (++_Next; _Next != _Last; )
1470  { // transfer ownership
1471  const_iterator _Iter = _Next++;
1472  _Orphan_ptr(_Right, _Iter._Ptr);
1473  _Iter._Adopt(this);
1474  }
1475  }
1476 
1477  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1478  if (this->_Getal() != _Right._Getal())
1479  _XSTD terminate();
1480  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1481 
1482  _Splice_same_after(_Where, _Right, _First, _Last);
1483  }
void _Splice_same_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1485
void __CRTDECL terminate()
Definition: exception:303
#define _XSTD
Definition: xstddef:20
iterator end() _NOEXCEPT
Definition: forward_list:956
_Mybase::const_iterator const_iterator
Definition: forward_list:717
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::_Splice_same_after ( const_iterator  _Where,
_Myt _Right,
const_iterator  _First,
const_iterator  _Last 
)
inlineprivate
1487  { // splice _Right (_First, _Last) just after _Where
1488  const_iterator _Next = _First;
1489  const_iterator _After = _Next;
1490  for (++_After; _After != _Last; ++_Next, ++_After)
1491  if (_After == _Right.end())
1492  { // find last element, and check for bad range
1493  _DEBUG_ERROR("forward_list splice_after invalid range");
1494  return;
1495  }
1496  this->_Nextnode(_Next._Mynode()) =
1497  this->_Nextnode(_Where._Mynode()); // link last to new home
1498  this->_Nextnode(_Where._Mynode()) =
1499  this->_Nextnode(_First._Mynode()); // link first to new home
1500  this->_Nextnode(_First._Mynode()) =
1501  _Last._Mynode(); // drop range from old home
1502  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: forward_list:452
_Mybase::const_iterator const_iterator
Definition: forward_list:717
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::_Tidy ( )
inlineprivate
1505  { // free all storage
1506  clear();
1507  }
void clear() _NOEXCEPT
Definition: forward_list:1179
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::assign ( _XSTD initializer_list< _Ty >  _Ilist)
inline
900  { // assign initializer_list
901  assign(_Ilist.begin(), _Ilist.end());
902  }
void assign(_XSTD initializer_list< _Ty > _Ilist)
Definition: forward_list:899
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, void>::type forward_list< _Ty, _Alloc >::assign ( _Iter  _First,
_Iter  _Last 
)
inline
1057  { // assign [_First, _Last), input iterators
1058  clear();
1059  insert_after(before_begin(), _First, _Last);
1060  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:851
void clear() _NOEXCEPT
Definition: forward_list:1179
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::assign ( size_type  _Count,
const _Ty &  _Val 
)
inline
1063  { // assign _Count * _Val
1064  clear();
1066  }
void clear() _NOEXCEPT
Definition: forward_list:1179
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
_Diff _Count
Definition: algorithm:1941
iterator _Insert_n_after(const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: forward_list:1509
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::before_begin ( )
inline
932  { // return iterator before beginning of mutable sequence
933  return (iterator((_Nodeptr)&this->_Myhead, this));
934  }
_Mybase::iterator iterator
Definition: forward_list:718
_Mybase::_Nodeptr _Nodeptr
Definition: forward_list:705
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::before_begin ( ) const
inline
937  { // return iterator before beginning of mutable sequence
938  return (iterator((_Nodeptr)&this->_Myhead, this));
939  }
_Mybase::iterator iterator
Definition: forward_list:718
_Mybase::_Nodeptr _Nodeptr
Definition: forward_list:705
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::begin ( )
inline
947  { // return iterator for beginning of mutable sequence
948  return (iterator(this->_Myhead, this));
949  }
_Mybase::iterator iterator
Definition: forward_list:718
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::begin ( ) const
inline
952  { // return iterator for beginning of nonmutable sequence
953  return (const_iterator(this->_Myhead, this));
954  }
_Mybase::const_iterator const_iterator
Definition: forward_list:717
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::cbefore_begin ( ) const
inline
942  { // return iterator before beginning of mutable sequence
943  return (iterator((_Nodeptr)&this->_Myhead, this));
944  }
_Mybase::iterator iterator
Definition: forward_list:718
_Mybase::_Nodeptr _Nodeptr
Definition: forward_list:705
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::cbegin ( ) const
inline
972  { // return iterator for beginning of nonmutable sequence
973  return (((const _Myt *)this)->begin());
974  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:702
iterator begin() _NOEXCEPT
Definition: forward_list:946
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::cend ( ) const
inline
977  { // return iterator for end of nonmutable sequence
978  return (((const _Myt *)this)->end());
979  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:702
iterator end() _NOEXCEPT
Definition: forward_list:956
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::clear ( )
inline
1180  { // erase all
1181  #if _ITERATOR_DEBUG_LEVEL == 2
1182  this->_Orphan_ptr(*this, 0);
1183  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1184 
1185  _Nodeptr _Pnext;
1186  _Nodeptr _Pnode = this->_Myhead;
1187  this->_Myhead = 0;
1188 
1189  for (; _Pnode != 0; _Pnode = _Pnext)
1190  { // delete an element
1191  _Pnext = this->_Nextnode(_Pnode);
1192 
1193  this->_Getal().destroy(_Pnode);
1194  this->_Getal().deallocate(_Pnode, 1);
1195  }
1196  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: forward_list:452
_Mybase::_Nodeptr _Nodeptr
Definition: forward_list:705
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
iterator forward_list< _Ty, _Alloc >::emplace_after ( const_iterator  _Where,
_Valty &&...  _Val 
)
inline
864  { // insert element at _Where
865  _Insert_after(_Where, _STD forward<_Valty>(_Val)...);
866  return (_Make_iter(++_Where));
867  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:966
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:870
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
void forward_list< _Ty, _Alloc >::emplace_front ( _Valty &&...  _Val)
inline
858  { // insert element at beginning
859  _Insert_after(before_begin(), _STD forward<_Valty>(_Val)...);
860  }
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:870
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
bool forward_list< _Ty, _Alloc >::empty ( ) const
inline
1024  { // test if sequence is empty
1025  return (begin() == end());
1026  }
iterator begin() _NOEXCEPT
Definition: forward_list:946
iterator end() _NOEXCEPT
Definition: forward_list:956
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::end ( )
inline
957  { // return iterator for end of mutable sequence
958  return (iterator(0, this));
959  }
_Mybase::iterator iterator
Definition: forward_list:718
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::end ( ) const
inline
962  { // return iterator for end of nonmutable sequence
963  return (const_iterator(0, this));
964  }
_Mybase::const_iterator const_iterator
Definition: forward_list:717
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::erase_after ( const_iterator  _Where)
inline
1127  { // erase element after _Where
1128  #if _ITERATOR_DEBUG_LEVEL == 2
1129  if (_Where._Getcont() != this
1130  || _Where == end())
1131  _DEBUG_ERROR("forward_list erase_after iterator outside range");
1132  _Nodeptr _Pnodeb = _Where._Mynode();
1133  _Orphan_ptr(*this, this->_Nextnode(_Pnodeb));
1134 
1135  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1136  _Nodeptr _Pnodeb = _Where._Mynode();
1137  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1138 
1139  if (++_Where == end())
1140  _DEBUG_ERROR("forward_list erase_after iterator outside range");
1141  else
1142  { // node exists, erase it
1143  _Nodeptr _Pnode = _Where._Mynode(); // subject node
1144  ++_Where; // point past subject node
1145 
1146  this->_Nextnode(_Pnodeb) = this->_Nextnode(_Pnode); // link past it
1147 
1148  this->_Getal().destroy(_Pnode);
1149  this->_Getal().deallocate(_Pnode, 1);
1150  }
1151 
1152  return (_Make_iter(_Where));
1153  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:966
iterator end() _NOEXCEPT
Definition: forward_list:956
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: forward_list:452
_Mybase::_Nodeptr _Nodeptr
Definition: forward_list:705
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::erase_after ( const_iterator  _First,
const_iterator  _Last 
)
inline
1157  { // erase (_First, _Last)
1158  if (_First == before_begin() && _Last == end())
1159  { // erase all and return fresh iterator
1160  clear();
1161  return (end());
1162  }
1163  else
1164  { // erase subrange
1165  if (_First == end() || _First == _Last)
1166  _DEBUG_ERROR("forward_list invalid erase_after range");
1167  else
1168  { // range not awful, try it
1169  const_iterator _After = _First;
1170  ++_After;
1171  _DEBUG_RANGE(_After, _Last);
1172  while (_After != _Last)
1173  _After = erase_after(_First);
1174  }
1175  return (_Make_iter(_Last));
1176  }
1177  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:966
void clear() _NOEXCEPT
Definition: forward_list:1179
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
iterator end() _NOEXCEPT
Definition: forward_list:956
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126
_Mybase::const_iterator const_iterator
Definition: forward_list:717
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
reference forward_list< _Ty, _Alloc >::front ( )
inline
1034  { // return first element of mutable sequence
1035  return (*begin());
1036  }
iterator begin() _NOEXCEPT
Definition: forward_list:946
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reference forward_list< _Ty, _Alloc >::front ( ) const
inline
1039  { // return first element of nonmutable sequence
1040  return (*begin());
1041  }
iterator begin() _NOEXCEPT
Definition: forward_list:946
template<class _Ty, class _Alloc = allocator<_Ty>>
allocator_type forward_list< _Ty, _Alloc >::get_allocator ( ) const
inline
1029  { // return allocator object for values
1030  return (this->_Getal());
1031  }
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::insert_after ( const_iterator  _Where,
_Ty &&  _Val 
)
inline
852  { // insert _Val at _Where
853  return (emplace_after(_Where, _STD forward<_Ty>(_Val)));
854  }
iterator emplace_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:863
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::insert_after ( const_iterator  _Where,
_XSTD initializer_list< _Ty >  _Ilist 
)
inline
906  { // insert initializer_list
907  return (insert_after(_Where, _Ilist.begin(), _Ilist.end()));
908  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:851
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::insert_after ( const_iterator  _Where,
const _Ty &  _Val 
)
inline
1069  { // insert _Val at _Where
1070  _Insert_after(_Where, _Val);
1071  return (_Make_iter(++_Where));
1072  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:966
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:870
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::insert_after ( const_iterator  _Where,
size_type  _Count,
const _Ty &  _Val 
)
inline
1076  { // insert _Count * _Val at _Where
1077  return (_Insert_n_after(_Where, _Count, _Val));
1078  }
_Diff _Count
Definition: algorithm:1941
iterator _Insert_n_after(const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: forward_list:1509
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, iterator>::type forward_list< _Ty, _Alloc >::insert_after ( const_iterator  _Where,
_Iter  _First,
_Iter  _Last 
)
inline
1085  { // insert [_First, _Last) at _Where
1086  return (_Insert_range(_Where, _First, _Last, _Iter_cat(_First)));
1087  }
iterator _Insert_range(const_iterator _Where, _Iter _First, _Iter _Last, input_iterator_tag)
Definition: forward_list:1090
iterator_traits< _Iter >::iterator_category _Iter_cat(const _Iter &)
Definition: xutility:404
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type forward_list< _Ty, _Alloc >::max_size ( ) const
inline
1019  { // return maximum possible length of sequence
1020  return (this->_Getal().max_size());
1021  }
size_type max_size() const _NOEXCEPT
Definition: forward_list:1018
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::merge ( _Myt _Right)
inline
1336  { // merge in elements from _Right, both ordered by operator<
1337  merge(_Right, less<>());
1338  }
void merge(_Myt &_Right)
Definition: forward_list:1335
Definition: xstddef:188
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::merge ( _Myt &&  _Right)
inline
1341  { // merge in elements from _Right, both ordered by operator<
1342  merge((_Myt&)_Right);
1343  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:702
void merge(_Myt &_Right)
Definition: forward_list:1335
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::merge ( _Myt _Right,
_Pr2  _Pred 
)
inline
1347  { // merge in elements from _Right, both ordered by _Pred
1348  if (&_Right != this)
1349  { // safe to merge, do it
1350  iterator _First1 = before_begin();
1351  iterator _After1 = begin();
1352  iterator _Last1 = end();
1353  iterator _First2 = _Right.before_begin();
1354  iterator _After2 = _Right.begin();
1355  iterator _Last2 = _Right.end();
1356  _DEBUG_ORDER_PRED(_After1, _Last1, _Pred);
1357  _DEBUG_ORDER_PRED(_After2, _Last2, _Pred);
1358 
1359  for (; _After1 != _Last1 && _After2 != _Last2; ++_First1)
1360  if (_DEBUG_LT_PRED(_Pred, *_After2, *_After1))
1361  { // splice in an element from _Right
1362  iterator _Mid2 = _After2;
1363  _Splice_after(_First1, _Right, _First2, ++_Mid2);
1364  _After2 = _Mid2;
1365  }
1366  else
1367  ++_After1;
1368 
1369  if (_After2 != _Last2)
1370  _Splice_after(_First1, _Right, _First2,
1371  _Last2); // splice remainder of _Right
1372  }
1373  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
void _Splice_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1457
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:462
Definition: xutility:337
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
iterator begin() _NOEXCEPT
Definition: forward_list:946
iterator end() _NOEXCEPT
Definition: forward_list:956
#define _DEBUG_ORDER_PRED(first, last, pred)
Definition: xutility:464
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::merge ( _Myt &&  _Right,
_Pr2  _Pred 
)
inline
1377  { // merge in elements from _Right, both ordered by _Pred
1378  merge((_Myt&)_Right, _Pred);
1379  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:702
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
void merge(_Myt &_Right)
Definition: forward_list:1335
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& forward_list< _Ty, _Alloc >::operator= ( _Myt &&  _Right)
inline
826  { // assign by moving _Right
827  if (this != &_Right)
828  { // different, assign it
829  clear();
830 
831  if (_Alty::propagate_on_container_move_assignment::value
832  && this->_Getal() != _Right._Getal())
833  this->_Change_alloc(_Right._Getal());
834 
835  _Assign_rv(_STD forward<_Myt>(_Right));
836  }
837  return (*this);
838  }
void clear() _NOEXCEPT
Definition: forward_list:1179
void _Assign_rv(_Myt &&_Right)
Definition: forward_list:840
void _Change_alloc(const _Alty &_Al)
Definition: forward_list:489
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& forward_list< _Ty, _Alloc >::operator= ( _XSTD initializer_list< _Ty >  _Ilist)
inline
894  { // assign initializer_list
895  assign(_Ilist.begin(), _Ilist.end());
896  return (*this);
897  }
void assign(_XSTD initializer_list< _Ty > _Ilist)
Definition: forward_list:899
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& forward_list< _Ty, _Alloc >::operator= ( const _Myt _Right)
inline
916  { // assign _Right
917  if (this != &_Right)
918  { // different, assign it
919  if (this->_Getal() != _Right._Getal()
920  && _Alty::propagate_on_container_copy_assignment::value)
921  { // change allocator before copying
922  clear();
923  this->_Change_alloc(_Right._Getal());
924  }
925 
926  assign(_Right.begin(), _Right.end());
927  }
928  return (*this);
929  }
void clear() _NOEXCEPT
Definition: forward_list:1179
void assign(_XSTD initializer_list< _Ty > _Ilist)
Definition: forward_list:899
void _Change_alloc(const _Alty &_Al)
Definition: forward_list:489
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::pop_front ( )
inline
1049  { // erase element at beginning
1051  }
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::push_front ( _Ty &&  _Val)
inline
847  { // insert element at beginning
848  _Insert_after(before_begin(), _STD forward<_Ty>(_Val));
849  }
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:870
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::push_front ( const _Ty &  _Val)
inline
1044  { // insert element at beginning
1046  }
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:870
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::remove ( const _Ty &  _Val)
inline
1276  { // erase each element matching _Val
1277  iterator _Firstb = before_begin();
1278  iterator _Val_it = end();
1279 
1280  for (iterator _First = begin(); _First != end(); )
1281  if (*_First == _Val)
1282  if (_STD addressof(*_First) == _STD addressof(_Val))
1283  { // store iterator to _Val and advance iterators
1284  _Val_it = _Firstb;
1285  ++_Firstb;
1286  ++_First;
1287  }
1288  else
1289  _First = erase_after(_Firstb);
1290  else
1291  { // advance iterators
1292  ++_Firstb;
1293  ++_First;
1294  }
1295 
1296  if (_Val_it != end())
1297  erase_after(_Val_it);
1298  }
Definition: xutility:337
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
iterator begin() _NOEXCEPT
Definition: forward_list:946
iterator end() _NOEXCEPT
Definition: forward_list:956
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr1 >
void forward_list< _Ty, _Alloc >::remove_if ( _Pr1  _Pred)
inline
1302  { // erase each element satisfying _Pr1
1303  iterator _Firstb = before_begin();
1304 
1305  for (iterator _First = begin(); _First != end(); )
1306  if (_Pred(*_First))
1307  _First = erase_after(_Firstb);
1308  else
1309  { // advance iterators
1310  ++_Firstb;
1311  ++_First;
1312  }
1313  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
Definition: xutility:337
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
iterator begin() _NOEXCEPT
Definition: forward_list:946
iterator end() _NOEXCEPT
Definition: forward_list:956
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::resize ( size_type  _Newsize)
inline
982  { // determine new length, padding with _Ty() elements as needed
983  size_type _Cursize = _Size();
984  if (_Cursize < _Newsize)
985  { // pad to make larger
986  const_iterator _Next = _Before_end();
987  _TRY_BEGIN
988  for (; _Cursize < _Newsize; ++_Cursize)
989  _Insert_after(_Next);
990  _CATCH_ALL
991  erase_after(_Next, end());
992  _RERAISE;
993  _CATCH_END
994  }
995  else if (_Newsize < _Cursize)
996  { // erase all but _Newsize elements
997  iterator _Next = before_begin();
998  for (; 0 < _Newsize; --_Newsize)
999  ++_Next;
1000  erase_after(_Next, end());
1001  }
1002  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
Definition: xutility:337
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:870
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
size_type _Size() const
Definition: forward_list:1441
const_iterator _Before_end() const
Definition: forward_list:1449
iterator end() _NOEXCEPT
Definition: forward_list:956
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: forward_list:709
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126
_Mybase::const_iterator const_iterator
Definition: forward_list:717
#define _RERAISE
Definition: xstddef:74
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::resize ( size_type  _Newsize,
const _Ty &  _Val 
)
inline
1005  { // determine new length, padding with _Val elements as needed
1006  size_type _Cursize = _Size();
1007  if (_Cursize < _Newsize)
1008  _Insert_n_after(_Before_end(), _Newsize - _Cursize, _Val);
1009  else if (_Newsize < _Cursize)
1010  { // erase all but _Newsize elements
1011  iterator _Next = before_begin();
1012  for (; 0 < _Newsize; --_Newsize)
1013  ++_Next;
1014  erase_after(_Next, end());
1015  }
1016  }
Definition: xutility:337
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
size_type _Size() const
Definition: forward_list:1441
const_iterator _Before_end() const
Definition: forward_list:1449
iterator end() _NOEXCEPT
Definition: forward_list:956
_Mybase::size_type size_type
Definition: forward_list:709
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126
iterator _Insert_n_after(const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: forward_list:1509
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::reverse ( )
inline
1431  { // reverse sequence
1432  if (!empty())
1433  { // worth doing, move to back in reverse order
1434  const_iterator _First = _Before_end();
1435  for (; begin() != _First; )
1436  _Splice_same_after(_First, *this, before_begin(), ++begin());
1437  }
1438  }
void _Splice_same_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1485
bool empty() const _NOEXCEPT
Definition: forward_list:1023
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
iterator begin() _NOEXCEPT
Definition: forward_list:946
const_iterator _Before_end() const
Definition: forward_list:1449
_Mybase::const_iterator const_iterator
Definition: forward_list:717
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::sort ( )
inline
1382  { // order sequence, using operator<
1383  sort(less<>());
1384  }
void sort()
Definition: forward_list:1381
Definition: xstddef:188
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::sort ( _Pr2  _Pred)
inline
1388  { // order sequence, using _Pred
1389  iterator _First = begin();
1390  if (_First != end() && ++_First != end())
1391  { // worth sorting, do it
1392  const size_t _MAXBINS = 25;
1393  _Myt _Templist(this->_Getal()), _Binlist[_MAXBINS + 1];
1394  size_t _Maxbin = 0;
1395 
1396  while (!empty())
1397  { // sort another element, using bins
1398  _Templist._Splice_same_after(_Templist.before_begin(), *this,
1399  before_begin(), ++begin());
1400 
1401  size_t _Bin;
1402  for (_Bin = 0; _Bin < _Maxbin && !_Binlist[_Bin].empty();
1403  ++_Bin)
1404  { // merge into ever larger bins
1405  _Binlist[_Bin].merge(_Templist, _Pred);
1406  _Binlist[_Bin].swap(_Templist);
1407  }
1408 
1409  if (_Bin == _MAXBINS)
1410  _Binlist[_Bin - 1].merge(_Templist, _Pred);
1411  else
1412  { // spill to new bin, while they last
1413  _Binlist[_Bin].swap(_Templist);
1414  if (_Bin == _Maxbin)
1415  ++_Maxbin;
1416  }
1417  }
1418 
1419  for (size_t _Bin = 1; _Bin < _Maxbin; ++_Bin)
1420  _Binlist[_Bin].merge(_Binlist[_Bin - 1],
1421  _Pred); // merge up
1422 
1423  _Analysis_assume_(0 < _Maxbin);
1424 
1426  _Binlist[_Maxbin - 1]); // result in last bin
1427  }
1428  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:702
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
void merge(_Myt &_Right)
Definition: forward_list:1335
Definition: xutility:337
bool empty() const _NOEXCEPT
Definition: forward_list:1023
iterator before_begin() _NOEXCEPT
Definition: forward_list:931
#define _Analysis_assume_(expr)
Definition: sal.h:2916
iterator begin() _NOEXCEPT
Definition: forward_list:946
iterator end() _NOEXCEPT
Definition: forward_list:956
void splice_after(const_iterator _Where, _Myt &_Right)
Definition: forward_list:1225
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt _Right 
)
inline
1226  { // splice all of _Right after _Where
1227  if (this != &_Right && !_Right.empty())
1228  { // worth splicing, do it
1229  _Splice_after(_Where, _Right,
1230  _Right.before_begin(), _Right.end());
1231  }
1232  }
void _Splice_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1457
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt &&  _Right 
)
inline
1235  { // splice all of _Right at _Where
1236  splice_after(_Where, (_Myt&)_Right);
1237  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:702
void splice_after(const_iterator _Where, _Myt &_Right)
Definition: forward_list:1225
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt _Right,
const_iterator  _First 
)
inline
1241  { // splice _Right (_First, _First + 2) after _Where
1242  const_iterator _After = _First;
1243  if (_First == _Right.end() || ++_After == _Right.end())
1244  _DEBUG_ERROR("forward_list splice_after iterator outside range");
1245  else
1246  { // element exists, try splice
1247  if (this != &_Right
1248  || (_Where != _First && _Where != _After))
1249  _Splice_after(_Where, _Right, _First, ++_After);
1250  }
1251  }
void _Splice_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1457
_Mybase::const_iterator const_iterator
Definition: forward_list:717
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt &&  _Right,
const_iterator  _First 
)
inline
1255  { // splice _Right [_First, _First + 1) at _Where
1256  splice_after(_Where, (_Myt&)_Right, _First);
1257  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:702
void splice_after(const_iterator _Where, _Myt &_Right)
Definition: forward_list:1225
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt _Right,
const_iterator  _First,
const_iterator  _Last 
)
inline
1261  { // splice _Right [_First, _Last) at _Where
1262  const_iterator _After = _First;
1263  if (_First == _Right.end())
1264  _DEBUG_ERROR("forward_list splice_after iterator outside range");
1265  else if (++_After != _Last && (this != &_Right || _Where != _First))
1266  _Splice_after(_Where, _Right, _First, _Last);
1267  }
void _Splice_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1457
_Mybase::const_iterator const_iterator
Definition: forward_list:717
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt &&  _Right,
const_iterator  _First,
const_iterator  _Last 
)
inline
1271  { // splice _Right [_First, _Last) at _Where
1272  splice_after(_Where, (_Myt&)_Right, _First, _Last);
1273  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:702
void splice_after(const_iterator _Where, _Myt &_Right)
Definition: forward_list:1225
_FwdIt _Last
Definition: algorithm:1936
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::swap ( _Myt _Right)
inline
1199  { // exchange contents with _Right
1200  if (this == &_Right)
1201  ; // same object, do nothing
1202  else if (this->_Getal() == _Right._Getal())
1203  { // same allocator, swap control information
1204  this->_Swap_all(_Right);
1205  _Swap_adl(this->_Myhead, _Right._Myhead);
1206  }
1207 
1208  else if (_Alty::propagate_on_container_swap::value)
1209  { // swap allocators and control information
1210  this->_Swap_alloc(_Right);
1211  _Swap_adl(this->_Myhead, _Right._Myhead);
1212  }
1213  else
1214  { // containers are incompatible
1215  #if _ITERATOR_DEBUG_LEVEL == 2
1216  _DEBUG_ERROR("forward_list containers incompatible for swap");
1217 
1218  #else /* ITERATOR_DEBUG_LEVEL == 2 */
1219  _XSTD terminate();
1220  #endif /* ITERATOR_DEBUG_LEVEL == 2 */
1221  }
1222 
1223  }
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 forward_list< _Ty, _Alloc >::unique ( )
inline
1316  { // erase each element matching previous
1317  unique(equal_to<>());
1318  }
Definition: xstddef:177
void unique()
Definition: forward_list:1315
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::unique ( _Pr2  _Pred)
inline
1322  { // erase each element satisfying _Pred with previous
1323  iterator _First = begin();
1324  if (_First != end())
1325  { // worth doing
1326  iterator _After = _First;
1327  for (++_After; _After != end(); )
1328  if (_Pred(*_First, *_After))
1329  _After = erase_after(_First);
1330  else
1331  _First = _After++;
1332  }
1333  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
Definition: xutility:337
iterator begin() _NOEXCEPT
Definition: forward_list:946
iterator end() _NOEXCEPT
Definition: forward_list:956
iterator erase_after(const_iterator _Where)
Definition: forward_list:1126

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