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< _Flist_base_types< _Ty, _Alloc > >

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_buy< _Ty, _Alloc_Myt
 
typedef _Flist_alloc< _Flist_base_types< _Ty, _Alloc > > _Mybase
 
typedef _Mybase::_Alty _Alty
 
typedef _Mybase::_Nodeptr _Nodeptr
 
- Public Types inherited from _Flist_alloc< _Flist_base_types< _Ty, _Alloc > >
typedef _Flist_alloc< _Flist_base_types< _Ty, _Alloc > > _Myt
 
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
 
typedef _Flist_base_types< _Ty, _Alloc >::_Val_types _Val_types
 
typedef _Nodeptr_Nodepref
 
typedef _Val_types::value_type value_type
 
typedef _Val_types::size_type size_type
 
typedef _Val_types::difference_type difference_type
 
typedef _Val_types::pointer pointer
 
typedef _Val_types::const_pointer const_pointer
 
typedef _Val_types::reference reference
 
typedef _Val_types::const_reference const_reference
 
typedef _Flist_const_iterator< _Flist_val< _Val_types > > const_iterator
 
typedef _Flist_iterator< _Flist_val< _Val_types > > iterator
 

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) _NOEXCEPT_OP(_Alty
 
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) _NOEXCEPT_OP(_Alty
 
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)
 
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)
 
template<class _Pr2 >
void _Merge1 (_Myt &_Right, _Pr2 &&_Pred)
 
void sort ()
 
template<class _Pr2 >
void sort (_Pr2 _Pred)
 
template<class _Pr2 >
void _Sort (iterator _Before_first, iterator _Last, _Pr2 &_Pred, size_type _Size)
 
void reverse () _NOEXCEPT
 
- Public Member Functions inherited from _Flist_buy< _Ty, _Alloc >
 _Flist_buy ()
 
template<class _Any_alloc , class = enable_if_t<!is_same<decay_t<_Any_alloc>, _Myt>::value>>
 _Flist_buy (_Any_alloc &&_Al)
 
_Nodeptr _Buynode0 (_Nodeptr _Next)
 
template<class... _Valty>
_Nodeptr _Buynode (_Nodeptr _Next, _Valty &&..._Val)
 
void _Freenode (_Nodeptr _Pnode)
 
- Public Member Functions inherited from _Flist_alloc< _Flist_base_types< _Ty, _Alloc > >
 _Flist_alloc ()
 
 _Flist_alloc (_Any_alloc &&_Al)
 
 ~_Flist_alloc () _NOEXCEPT
 
void _Copy_alloc (const _Alty &_Al)
 
void _Move_alloc (_Alty &_Al)
 
void _Orphan_all ()
 
void _Swap_all (_Myt &_Right)
 
_Alty_Getal () _NOEXCEPT
 
const _Alty_Getal () const _NOEXCEPT
 
_Flist_val< _Val_types > & _Get_data () _NOEXCEPT
 
const _Flist_val< _Val_types > & _Get_data () const _NOEXCEPT
 
_Nodeptr_Myhead () _NOEXCEPT
 
const _Nodeptr_Myhead () const _NOEXCEPT
 
_Nodeptr _Before_head () const _NOEXCEPT
 

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_alloc< _Flist_base_types< _Ty, _Alloc > >
static _Nodepref _Nextnode (_Nodeptr _Pnode)
 
static reference _Myval (_Nodeptr _Pnode)
 

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
746  : _Mybase()
747  { // construct empty list
748  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( size_type  _Count)
inlineexplicit
751  : _Mybase()
752  { // construct list from _Count * _Ty()
753  resize(_Count);
754  }
void resize(size_type _Newsize)
Definition: forward_list:1007
unsigned int _Count
Definition: xcomplex:668
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( size_type  _Count,
const _Ty &  _Val 
)
inline
757  : _Mybase()
758  { // construct list from _Count * _Val
760  }
unsigned int _Count
Definition: xcomplex:668
_In_ int _Val
Definition: vcruntime_string.h:62
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
void _Construct_n(size_type _Count, const _Ty &_Val)
Definition: forward_list:827
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( size_type  _Count,
const _Ty &  _Val,
const _Alloc _Al 
)
inline
763  : _Mybase(_Al)
764  { // construct list from _Count * _Val, allocator
766  }
unsigned int _Count
Definition: xcomplex:668
_In_ int _Val
Definition: vcruntime_string.h:62
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
void _Construct_n(size_type _Count, const _Ty &_Val)
Definition: forward_list:827
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( const _Alloc _Al)
inlineexplicit
769  : _Mybase(_Al)
770  { // construct empty list, allocator
771  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( const _Myt _Right)
inline
775  : _Mybase(_Right._Getal().select_on_container_copy_construction())
776 
777 
778  { // construct list by copying _Right
779  _TRY_BEGIN
780  insert_after(before_begin(), _Right.begin(), _Right.end());
781  _CATCH_ALL
782  _Tidy();
783  _RERAISE;
784  _CATCH_END
785  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:877
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
#define _CATCH_ALL
Definition: xstddef:62
void _Tidy()
Definition: forward_list:1524
#define _RERAISE
Definition: xstddef:74
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( const _Myt _Right,
const _Alloc _Al 
)
inline
788  : _Mybase(_Al)
789  { // construct list by copying _Right, allocator
790  _TRY_BEGIN
791  insert_after(before_begin(), _Right.begin(), _Right.end());
792  _CATCH_ALL
793  _Tidy();
794  _RERAISE;
795  _CATCH_END
796  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:877
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
#define _CATCH_ALL
Definition: xstddef:62
void _Tidy()
Definition: forward_list:1524
#define _RERAISE
Definition: xstddef:74
constexpr const _Ty &() _Right
Definition: algorithm:3591
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
802  : _Mybase()
803  { // construct list from [_First, _Last,
804  _Construct(_First, _Last);
805  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
void _Construct(_Iter _First, _Iter _Last)
Definition: forward_list:817
_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
811  : _Mybase(_Al)
812  { // construct list, allocator from [_First, _Last)
813  _Construct(_First, _Last);
814  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
void _Construct(_Iter _First, _Iter _Last)
Definition: forward_list:817
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( _Myt &&  _Right)
inline
839  : _Mybase(_STD move(_Right._Getal()))
840  { // construct list by moving _Right
841  _Assign_rv(_STD forward<_Myt>(_Right));
842  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
void _Assign_rv(_Myt &&_Right)
Definition: forward_list:866
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( _Myt &&  _Right,
const _Alloc _Al 
)
inline
845  : _Mybase(_Al)
846  { // construct list by moving _Right, allocator
847  _Assign_rv(_STD forward<_Myt>(_Right));
848  }
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
void _Assign_rv(_Myt &&_Right)
Definition: forward_list:866
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::forward_list ( _XSTD initializer_list< _Ty >  _Ilist,
const _Alloc _Al = allocator_type() 
)
inline
914  : _Mybase(_Al)
915  { // construct from initializer_list
916  insert_after(before_begin(), _Ilist.begin(), _Ilist.end());
917  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:877
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
_Flist_buy< _Ty, _Alloc > _Mybase
Definition: forward_list:728
template<class _Ty, class _Alloc = allocator<_Ty>>
forward_list< _Ty, _Alloc >::~forward_list ( )
inline
937  { // destroy the object
938  _Tidy();
939  }
void _Tidy()
Definition: forward_list:1524

Member Function Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::_Assign_rv ( _Myt &&  _Right)
inline
867  { // swap with empty *this, same allocator
868  this->_Swap_all(_Right);
869  _Swap_adl(this->_Myhead(), _Right._Myhead());
870  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: forward_list:633
void _Swap_all(_Myt &_Right)
Definition: forward_list:608
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:56
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::_Before_end ( ) const
inlineprivate
1470  { // get iterator just before end
1471  const_iterator _Next = before_begin();
1472  for (const_iterator _Nextp = _Next; ++_Nextp != end(); )
1473  _Next = _Nextp;
1474  return (_Next);
1475  }
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
iterator end() _NOEXCEPT
Definition: forward_list:982
_Mybase::const_iterator const_iterator
Definition: forward_list:742
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void forward_list< _Ty, _Alloc >::_Construct ( _Iter  _First,
_Iter  _Last 
)
inline
818  { // construct list from [_First, _Last), input iterators
819  _TRY_BEGIN
820  insert_after(before_begin(), _First, _Last);
821  _CATCH_ALL
822  _Tidy();
823  _RERAISE;
824  _CATCH_END
825  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:877
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
#define _CATCH_ALL
Definition: xstddef:62
void _Tidy()
Definition: forward_list:1524
#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
829  { // construct from _Count * _Val
830  _TRY_BEGIN
832  _CATCH_ALL
833  _Tidy();
834  _RERAISE;
835  _CATCH_END
836  }
unsigned int _Count
Definition: xcomplex:668
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
_In_ int _Val
Definition: vcruntime_string.h:62
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
#define _CATCH_ALL
Definition: xstddef:62
void _Tidy()
Definition: forward_list:1524
#define _RERAISE
Definition: xstddef:74
iterator _Insert_n_after(const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: forward_list:1529
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
void forward_list< _Ty, _Alloc >::_Insert_after ( const_iterator  _Where,
_Valty &&...  _Val 
)
inline
898  { // insert element after _Where
899  #if _ITERATOR_DEBUG_LEVEL == 2
900  if (_Where._Getcont() != &this->_Get_data())
901  _DEBUG_ERROR("forward_list insert_after iterator outside range");
902  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
903 
904  _Nodeptr _Pnode = _Where._Mynode();
905  _Nodeptr _Newnode =
906  this->_Buynode(this->_Nextnode(_Pnode),
907  _STD forward<_Valty>(_Val)...);
908  this->_Nextnode(_Pnode) = _Newnode;
909  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: forward_list:495
_In_ int _Val
Definition: vcruntime_string.h:62
_Flist_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: forward_list:623
_Mybase::_Nodeptr _Nodeptr
Definition: forward_list:730
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_Nodeptr _Buynode(_Nodeptr _Next, _Valty &&..._Val)
Definition: forward_list:692
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
1531  { // insert _Count * _Val after _Where
1532  size_type _Countsave = _Count;
1533 
1534  _TRY_BEGIN
1535  for (; 0 < _Count; --_Count, (void)++_Where)
1536  _Insert_after(_Where, _Val);
1537  _CATCH_ALL
1538  for (; _Count < _Countsave; ++_Count)
1539  erase_after(_Where);
1540  _RERAISE;
1541  _CATCH_END
1542  return (_Make_iter(_Where));
1543  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:992
unsigned int _Count
Definition: xcomplex:668
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
_In_ int _Val
Definition: vcruntime_string.h:62
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:896
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: forward_list:734
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
#define _RERAISE
Definition: xstddef:74
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
1119  { // insert [_First, _Last) after _Where, input iterators
1120  size_type _Num = 0;
1121  const_iterator _After = _Where;
1122 
1123  _TRY_BEGIN
1124  for (; _First != _Last; ++_After, (void)++_First, ++_Num)
1125  _Insert_after(_After, *_First);
1126  _CATCH_ALL
1127  for (; 0 < _Num; --_Num)
1128  erase_after(_Where);
1129  _RERAISE;
1130  _CATCH_END
1131  return (_Make_iter(_After));
1132  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:992
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:896
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: forward_list:734
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153
_Mybase::const_iterator const_iterator
Definition: forward_list:742
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
#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
1137  { // insert [_First, _Last) after _Where, forward iterators
1138  _DEBUG_RANGE(_First, _Last);
1139  _Iter _Next = _First;
1140  const_iterator _After = _Where;
1141 
1142  _TRY_BEGIN
1143  for (; _First != _Last; ++_After, (void)++_First)
1144  _Insert_after(_After, *_First);
1145  _CATCH_ALL
1146  for (; _Next != _First; ++_Next)
1147  erase_after(_Where);
1148  _RERAISE;
1149  _CATCH_END
1150  return (_Make_iter(_After));
1151  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:992
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:896
#define _CATCH_ALL
Definition: xstddef:62
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153
_Mybase::const_iterator const_iterator
Definition: forward_list:742
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
#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
993  { // make iterator from const_iterator
994  return (iterator(_Where._Ptr, &this->_Get_data()));
995  }
_Mybase::iterator iterator
Definition: forward_list:743
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::_Merge1 ( _Myt _Right,
_Pr2 &&  _Pred 
)
inline
1375  { // merge in elements from _Right, both ordered by _Pred
1376  if (&_Right != this)
1377  { // safe to merge, do it
1378  iterator _First1 = before_begin();
1379  iterator _After1 = begin();
1380  iterator _Last1 = end();
1381  iterator _First2 = _Right.before_begin();
1382  iterator _After2 = _Right.begin();
1383  iterator _Last2 = _Right.end();
1384  _DEBUG_ORDER_PRED(_After1, _Last1, _Pred);
1385  _DEBUG_ORDER_PRED(_After2, _Last2, _Pred);
1386 
1387  for (; _After1 != _Last1 && _After2 != _Last2; ++_First1)
1388  if (_DEBUG_LT_PRED(_Pred, *_After2, *_After1))
1389  { // splice in an element from _Right
1390  iterator _Mid2 = _After2;
1391  _Splice_after(_First1, _Right, _First2, ++_Mid2);
1392  _After2 = _Mid2;
1393  }
1394  else
1395  ++_After1;
1396 
1397  if (_After2 != _Last2)
1398  _Splice_after(_First1, _Right, _First2,
1399  _Last2); // splice remainder of _Right
1400  }
1401  }
_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:1477
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:817
Definition: xutility:563
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
iterator begin() _NOEXCEPT
Definition: forward_list:972
iterator end() _NOEXCEPT
Definition: forward_list:982
#define _DEBUG_ORDER_PRED(first, last, pred)
Definition: xutility:818
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr1 >
void forward_list< _Ty, _Alloc >::_Remove_if ( _Pr1 &  _Pred)
inline
1318  { // erase each element satisfying _Pr1
1319  iterator _Firstb = before_begin();
1320 
1321  for (iterator _First = begin(); _First != end(); )
1322  if (_Pred(*_First))
1323  _First = erase_after(_Firstb);
1324  else
1325  { // advance iterators
1326  ++_Firstb;
1327  ++_First;
1328  }
1329  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
Definition: xutility:563
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
iterator begin() _NOEXCEPT
Definition: forward_list:972
iterator end() _NOEXCEPT
Definition: forward_list:982
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type forward_list< _Ty, _Alloc >::_Size ( ) const
inlineprivate
1462  { // get size by counting
1463  size_type _Ans = 0;
1464  for (const_iterator _Next = begin(); _Next != end(); ++_Next)
1465  ++_Ans;
1466  return (_Ans);
1467  }
iterator begin() _NOEXCEPT
Definition: forward_list:972
iterator end() _NOEXCEPT
Definition: forward_list:982
_Mybase::size_type size_type
Definition: forward_list:734
_Mybase::const_iterator const_iterator
Definition: forward_list:742
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::_Sort ( iterator  _Before_first,
iterator  _Last,
_Pr2 &  _Pred,
size_type  _Size 
)
inline
1417  { // order (_Before_first, _Last), using _Pred
1418  // _Size must be number of elements in range
1419  if (_Size < 2)
1420  return; // nothing to do
1421 
1422  iterator _Mid = _STD next(_Before_first, 1 + _Size / 2);
1423  _Sort(_Before_first, _Mid, _Pred, _Size / 2);
1424  iterator _First = _STD next(_Before_first);
1425 
1426  iterator _Before_mid = _STD next(_Before_first, _Size / 2);
1427  _Sort(_Before_mid, _Last, _Pred, _Size - _Size / 2);
1428  _Mid = _STD next(_Before_mid);
1429 
1430  for (; ; )
1431  { // [_First, _Mid) and [_Mid, _Last) are sorted and non-empty
1432  if (_DEBUG_LT_PRED(_Pred, *_Mid, *_First))
1433  { // consume _Mid
1434  splice_after(_Before_first, *this, _Before_mid);
1435  ++_Before_first;
1436  _Mid = _STD next(_Before_mid);
1437  if (_Mid == _Last)
1438  return; // exhausted [_Mid, _Last); done
1439  }
1440  else
1441  { // consume _First
1442  ++_Before_first;
1443  ++_First;
1444  if (_First == _Mid)
1445  return; // exhausted [_First, _Mid); done
1446  }
1447  }
1448  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:817
Definition: xutility:563
size_type _Size() const
Definition: forward_list:1461
_InIt next(_InIt _First, _Iter_diff_t< _InIt > _Off=1)
Definition: xutility:1131
void splice_after(const_iterator _Where, _Myt &_Right)
Definition: forward_list:1235
void _Sort(iterator _Before_first, iterator _Last, _Pr2 &_Pred, size_type _Size)
Definition: forward_list:1415
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
1479  { // splice _Right (_First, _Last) just after _Where
1480  #if _ITERATOR_DEBUG_LEVEL == 2
1481  if (_Where._Getcont() != &this->_Get_data() || _Where == end())
1482  _DEBUG_ERROR("forward_list splice_after iterator outside range");
1483  if (this->_Getal() != _Right._Getal())
1484  _DEBUG_ERROR("forward_list containers incompatible for splice_after");
1485 
1486  if (this != &_Right)
1487  { // transfer ownership of (_First, _Last)
1488  const_iterator _Next = _First;
1489  for (++_Next; _Next != _Last; )
1490  { // transfer ownership
1491  const_iterator _Iter = _Next++;
1492  _Right._Orphan_ptr(_Iter._Ptr);
1493  _Iter._Adopt(&this->_Get_data());
1494  }
1495  }
1496 
1497  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1498  if (this->_Getal() != _Right._Getal())
1499  _XSTD terminate();
1500  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1501 
1502  _Splice_same_after(_Where, _Right, _First, _Last);
1503  }
_Alty & _Getal() _NOEXCEPT
Definition: forward_list:613
void _Splice_same_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1505
_Flist_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: forward_list:623
#define _XSTD
Definition: xstddef:21
void __CRTDECL terminate() _NOEXCEPT
Definition: exception:208
iterator end() _NOEXCEPT
Definition: forward_list:982
_Mybase::const_iterator const_iterator
Definition: forward_list:742
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt _Last
Definition: algorithm:1936
constexpr const _Ty &() _Right
Definition: algorithm:3591
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
1507  { // splice _Right (_First, _Last) just after _Where
1508  const_iterator _Next = _First;
1509  const_iterator _After = _Next;
1510  for (++_After; _After != _Last; ++_Next, (void)++_After)
1511  if (_After == _Right.end())
1512  { // find last element, and check for bad range
1513  _DEBUG_ERROR("forward_list splice_after invalid range");
1514  return;
1515  }
1516  this->_Nextnode(_Next._Mynode()) =
1517  this->_Nextnode(_Where._Mynode()); // link last to new home
1518  this->_Nextnode(_Where._Mynode()) =
1519  this->_Nextnode(_First._Mynode()); // link first to new home
1520  this->_Nextnode(_First._Mynode()) =
1521  _Last._Mynode(); // drop range from old home
1522  }
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: forward_list:495
_Mybase::const_iterator const_iterator
Definition: forward_list:742
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
_FwdIt _Last
Definition: algorithm:1936
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::_Tidy ( )
inlineprivate
1525  { // free all storage
1526  clear();
1527  }
void clear() _NOEXCEPT
Definition: forward_list:1206
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::assign ( _XSTD initializer_list< _Ty >  _Ilist)
inline
926  { // assign initializer_list
927  assign(_Ilist.begin(), _Ilist.end());
928  }
void assign(_XSTD initializer_list< _Ty > _Ilist)
Definition: forward_list:925
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
1084  { // assign [_First, _Last), input iterators
1085  clear();
1086  insert_after(before_begin(), _First, _Last);
1087  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:877
void clear() _NOEXCEPT
Definition: forward_list:1206
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
_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
1090  { // assign _Count * _Val
1091  clear();
1093  }
void clear() _NOEXCEPT
Definition: forward_list:1206
unsigned int _Count
Definition: xcomplex:668
_In_ int _Val
Definition: vcruntime_string.h:62
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
iterator _Insert_n_after(const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: forward_list:1529
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::before_begin ( )
inline
958  { // return iterator before beginning of mutable sequence
959  return (iterator(this->_Before_head(), &this->_Get_data()));
960  }
_Nodeptr _Before_head() const _NOEXCEPT
Definition: forward_list:643
_Mybase::iterator iterator
Definition: forward_list:743
_Flist_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: forward_list:623
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::before_begin ( ) const
inline
963  { // return iterator before beginning of nonmutable sequence
964  return (const_iterator(this->_Before_head(), &this->_Get_data()));
965  }
_Nodeptr _Before_head() const _NOEXCEPT
Definition: forward_list:643
_Flist_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: forward_list:623
_Mybase::const_iterator const_iterator
Definition: forward_list:742
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::begin ( )
inline
973  { // return iterator for beginning of mutable sequence
974  return (iterator(this->_Myhead(), &this->_Get_data()));
975  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: forward_list:633
_Mybase::iterator iterator
Definition: forward_list:743
_Flist_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: forward_list:623
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::begin ( ) const
inline
978  { // return iterator for beginning of nonmutable sequence
979  return (const_iterator(this->_Myhead(), &this->_Get_data()));
980  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: forward_list:633
_Flist_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: forward_list:623
_Mybase::const_iterator const_iterator
Definition: forward_list:742
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::cbefore_begin ( ) const
inline
968  { // return iterator before beginning of nonmutable sequence
969  return (before_begin());
970  }
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::cbegin ( ) const
inline
998  { // return iterator for beginning of nonmutable sequence
999  return (begin());
1000  }
iterator begin() _NOEXCEPT
Definition: forward_list:972
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::cend ( ) const
inline
1003  { // return iterator for end of nonmutable sequence
1004  return (end());
1005  }
iterator end() _NOEXCEPT
Definition: forward_list:982
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::clear ( )
inline
1207  { // erase all
1208  #if _ITERATOR_DEBUG_LEVEL == 2
1209  this->_Orphan_ptr(nullptr_t{});
1210  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1211 
1212  _Nodeptr _Pnext;
1213  _Nodeptr _Pnode = this->_Myhead();
1214  this->_Myhead() = nullptr_t{};
1215 
1216  for (; _Pnode != nullptr_t{}; _Pnode = _Pnext)
1217  { // delete an element
1218  _Pnext = this->_Nextnode(_Pnode);
1219 
1220  this->_Freenode(_Pnode);
1221  }
1222  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: forward_list:633
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: forward_list:495
_Mybase::_Nodeptr _Nodeptr
Definition: forward_list:730
void _Freenode(_Nodeptr _Pnode)
Definition: forward_list:710
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
iterator forward_list< _Ty, _Alloc >::emplace_after ( const_iterator  _Where,
_Valty &&...  _Val 
)
inline
890  { // insert element at _Where
891  _Insert_after(_Where, _STD forward<_Valty>(_Val)...);
892  return (_Make_iter(++_Where));
893  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:992
_In_ int _Val
Definition: vcruntime_string.h:62
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:896
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
void forward_list< _Ty, _Alloc >::emplace_front ( _Valty &&...  _Val)
inline
884  { // insert element at beginning
885  _Insert_after(before_begin(), _STD forward<_Valty>(_Val)...);
886  }
_In_ int _Val
Definition: vcruntime_string.h:62
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:896
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
template<class _Ty, class _Alloc = allocator<_Ty>>
bool forward_list< _Ty, _Alloc >::empty ( ) const
inline
1050  { // test if sequence is empty
1051  return (begin() == end());
1052  }
iterator begin() _NOEXCEPT
Definition: forward_list:972
iterator end() _NOEXCEPT
Definition: forward_list:982
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::end ( )
inline
983  { // return iterator for end of mutable sequence
984  return (iterator(nullptr_t{}, &this->_Get_data()));
985  }
_Mybase::iterator iterator
Definition: forward_list:743
_Flist_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: forward_list:623
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator forward_list< _Ty, _Alloc >::end ( ) const
inline
988  { // return iterator for end of nonmutable sequence
989  return (const_iterator(nullptr_t{}, &this->_Get_data()));
990  }
_Flist_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: forward_list:623
_Mybase::const_iterator const_iterator
Definition: forward_list:742
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::erase_after ( const_iterator  _Where)
inline
1154  { // erase element after _Where
1155  #if _ITERATOR_DEBUG_LEVEL == 2
1156  if (_Where._Getcont() != &this->_Get_data()
1157  || _Where == end())
1158  _DEBUG_ERROR("forward_list erase_after iterator outside range");
1159  _Nodeptr _Pnodeb = _Where._Mynode();
1160  _Orphan_ptr(this->_Nextnode(_Pnodeb));
1161 
1162  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1163  _Nodeptr _Pnodeb = _Where._Mynode();
1164  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1165 
1166  if (++_Where == end())
1167  _DEBUG_ERROR("forward_list erase_after iterator outside range");
1168  else
1169  { // node exists, erase it
1170  _Nodeptr _Pnode = _Where._Mynode(); // subject node
1171  ++_Where; // point past subject node
1172 
1173  this->_Nextnode(_Pnodeb) =
1174  this->_Nextnode(_Pnode); // link past it
1175 
1176  this->_Freenode(_Pnode);
1177  }
1178 
1179  return (_Make_iter(_Where));
1180  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:992
static _Nodepref _Nextnode(_Nodeptr _Pnode)
Definition: forward_list:495
_Flist_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: forward_list:623
iterator end() _NOEXCEPT
Definition: forward_list:982
_Mybase::_Nodeptr _Nodeptr
Definition: forward_list:730
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
void _Freenode(_Nodeptr _Pnode)
Definition: forward_list:710
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::erase_after ( const_iterator  _First,
const_iterator  _Last 
)
inline
1184  { // erase (_First, _Last)
1185  if (_First == before_begin() && _Last == end())
1186  { // erase all and return fresh iterator
1187  clear();
1188  return (end());
1189  }
1190  else
1191  { // erase subrange
1192  if (_First == end() || _First == _Last)
1193  _DEBUG_ERROR("forward_list invalid erase_after range");
1194  else
1195  { // range not awful, try it
1196  const_iterator _After = _First;
1197  ++_After;
1198  _DEBUG_RANGE(_After, _Last);
1199  while (_After != _Last)
1200  _After = erase_after(_First);
1201  }
1202  return (_Make_iter(_Last));
1203  }
1204  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:992
void clear() _NOEXCEPT
Definition: forward_list:1206
#define _DEBUG_RANGE(first, last)
Definition: xutility:822
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
iterator end() _NOEXCEPT
Definition: forward_list:982
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153
_Mybase::const_iterator const_iterator
Definition: forward_list:742
#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
1061  { // return first element of mutable sequence
1062  return (*begin());
1063  }
iterator begin() _NOEXCEPT
Definition: forward_list:972
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reference forward_list< _Ty, _Alloc >::front ( ) const
inline
1066  { // return first element of nonmutable sequence
1067  return (*begin());
1068  }
iterator begin() _NOEXCEPT
Definition: forward_list:972
template<class _Ty, class _Alloc = allocator<_Ty>>
allocator_type forward_list< _Ty, _Alloc >::get_allocator ( ) const
inline
1055  { // return allocator object for values
1056  allocator_type _Ret(this->_Getal());
1057  return (_Ret);
1058  }
_Alty & _Getal() _NOEXCEPT
Definition: forward_list:613
_Alloc allocator_type
Definition: forward_list:733
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::insert_after ( const_iterator  _Where,
_Ty &&  _Val 
)
inline
878  { // insert _Val at _Where
879  return (emplace_after(_Where, _STD forward<_Ty>(_Val)));
880  }
_In_ int _Val
Definition: vcruntime_string.h:62
iterator emplace_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:889
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::insert_after ( const_iterator  _Where,
_XSTD initializer_list< _Ty >  _Ilist 
)
inline
932  { // insert initializer_list
933  return (insert_after(_Where, _Ilist.begin(), _Ilist.end()));
934  }
iterator insert_after(const_iterator _Where, _Ty &&_Val)
Definition: forward_list:877
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::insert_after ( const_iterator  _Where,
const _Ty &  _Val 
)
inline
1096  { // insert _Val at _Where
1097  _Insert_after(_Where, _Val);
1098  return (_Make_iter(++_Where));
1099  }
iterator _Make_iter(const_iterator _Where) const
Definition: forward_list:992
_In_ int _Val
Definition: vcruntime_string.h:62
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:896
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator forward_list< _Ty, _Alloc >::insert_after ( const_iterator  _Where,
size_type  _Count,
const _Ty &  _Val 
)
inline
1103  { // insert _Count * _Val at _Where
1104  return (_Insert_n_after(_Where, _Count, _Val));
1105  }
unsigned int _Count
Definition: xcomplex:668
_In_ int _Val
Definition: vcruntime_string.h:62
iterator _Insert_n_after(const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: forward_list:1529
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
1112  { // insert [_First, _Last) at _Where
1113  return (_Insert_range(_Where, _First, _Last, _Iter_cat_t<_Iter>()));
1114  }
typename iterator_traits< _Iter >::iterator_category _Iter_cat_t
Definition: xutility:655
iterator _Insert_range(const_iterator _Where, _Iter _First, _Iter _Last, input_iterator_tag)
Definition: forward_list:1117
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type forward_list< _Ty, _Alloc >::max_size ( ) const
inline
1045  { // return maximum possible length of sequence
1046  return (this->_Getal().max_size());
1047  }
_Alty & _Getal() _NOEXCEPT
Definition: forward_list:613
size_type max_size() const _NOEXCEPT
Definition: forward_list:1044
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::merge ( _Myt _Right)
inline
1352  { // merge in elements from _Right, both ordered by operator<
1353  _Merge1(_Right, less<>());
1354  }
void _Merge1(_Myt &_Right, _Pr2 &&_Pred)
Definition: forward_list:1374
Definition: xstddef:231
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::merge ( _Myt &&  _Right)
inline
1357  { // merge in elements from _Right, both ordered by operator<
1358  _Merge1(_Right, less<>());
1359  }
void _Merge1(_Myt &_Right, _Pr2 &&_Pred)
Definition: forward_list:1374
Definition: xstddef:231
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::merge ( _Myt _Right,
_Pr2  _Pred 
)
inline
1363  { // merge in elements from _Right, both ordered by _Pred
1364  _Merge1(_Right, _Pred);
1365  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
void _Merge1(_Myt &_Right, _Pr2 &&_Pred)
Definition: forward_list:1374
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::merge ( _Myt &&  _Right,
_Pr2  _Pred 
)
inline
1369  { // merge in elements from _Right, both ordered by _Pred
1370  _Merge1(_Right, _Pred);
1371  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
void _Merge1(_Myt &_Right, _Pr2 &&_Pred)
Definition: forward_list:1374
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& forward_list< _Ty, _Alloc >::operator= ( _Myt &&  _Right)
inline
852  { // assign by moving _Right
853  if (this != &_Right)
854  { // different, assign it
855  clear();
856 
857  if (_Alty::propagate_on_container_move_assignment::value
858  && this->_Getal() != _Right._Getal())
859  this->_Move_alloc(_Right._Getal());
860 
861  _Assign_rv(_STD forward<_Myt>(_Right));
862  }
863  return (*this);
864  }
_Alty & _Getal() _NOEXCEPT
Definition: forward_list:613
void _Move_alloc(_Alty &_Al)
Definition: forward_list:528
void clear() _NOEXCEPT
Definition: forward_list:1206
void _Assign_rv(_Myt &&_Right)
Definition: forward_list:866
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& forward_list< _Ty, _Alloc >::operator= ( _XSTD initializer_list< _Ty >  _Ilist)
inline
920  { // assign initializer_list
921  assign(_Ilist.begin(), _Ilist.end());
922  return (*this);
923  }
void assign(_XSTD initializer_list< _Ty > _Ilist)
Definition: forward_list:925
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& forward_list< _Ty, _Alloc >::operator= ( const _Myt _Right)
inline
942  { // assign _Right
943  if (this != &_Right)
944  { // different, assign it
945  if (this->_Getal() != _Right._Getal()
946  && _Alty::propagate_on_container_copy_assignment::value)
947  { // change allocator before copying
948  clear();
949  this->_Copy_alloc(_Right._Getal());
950  }
951 
952  assign(_Right.begin(), _Right.end());
953  }
954  return (*this);
955  }
_Alty & _Getal() _NOEXCEPT
Definition: forward_list:613
void clear() _NOEXCEPT
Definition: forward_list:1206
void assign(_XSTD initializer_list< _Ty > _Ilist)
Definition: forward_list:925
constexpr const _Ty &() _Right
Definition: algorithm:3591
void _Copy_alloc(const _Alty &_Al)
Definition: forward_list:523
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::pop_front ( )
inline
1076  { // erase element at beginning
1078  }
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::push_front ( _Ty &&  _Val)
inline
873  { // insert element at beginning
874  _Insert_after(before_begin(), _STD forward<_Ty>(_Val));
875  }
_In_ int _Val
Definition: vcruntime_string.h:62
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:896
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::push_front ( const _Ty &  _Val)
inline
1071  { // insert element at beginning
1073  }
_In_ int _Val
Definition: vcruntime_string.h:62
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:896
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::remove ( const _Ty &  _Val)
inline
1286  { // erase each element matching _Val
1287  iterator _Firstb = before_begin();
1288  iterator _Val_it = end();
1289 
1290  for (iterator _First = begin(); _First != end(); )
1291  if (*_First == _Val)
1292  if (_STD addressof(*_First) == _STD addressof(_Val))
1293  { // store iterator to _Val and advance iterators
1294  _Val_it = _Firstb;
1295  ++_Firstb;
1296  ++_First;
1297  }
1298  else
1299  _First = erase_after(_Firstb);
1300  else
1301  { // advance iterators
1302  ++_Firstb;
1303  ++_First;
1304  }
1305 
1306  if (_Val_it != end())
1307  erase_after(_Val_it);
1308  }
constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:723
Definition: xutility:563
_In_ int _Val
Definition: vcruntime_string.h:62
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
iterator begin() _NOEXCEPT
Definition: forward_list:972
iterator end() _NOEXCEPT
Definition: forward_list:982
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr1 >
void forward_list< _Ty, _Alloc >::remove_if ( _Pr1  _Pred)
inline
1312  { // erase each element satisfying _Pr1
1313  _Remove_if(_Pred);
1314  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
void _Remove_if(_Pr1 &_Pred)
Definition: forward_list:1317
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::resize ( size_type  _Newsize)
inline
1008  { // determine new length, padding with _Ty() elements as needed
1009  size_type _Cursize = _Size();
1010  if (_Cursize < _Newsize)
1011  { // pad to make larger
1012  const_iterator _Next = _Before_end();
1013  _TRY_BEGIN
1014  for (; _Cursize < _Newsize; ++_Cursize)
1015  _Insert_after(_Next);
1016  _CATCH_ALL
1017  erase_after(_Next, end());
1018  _RERAISE;
1019  _CATCH_END
1020  }
1021  else if (_Newsize < _Cursize)
1022  { // erase all but _Newsize elements
1023  iterator _Next = before_begin();
1024  for (; 0 < _Newsize; --_Newsize)
1025  ++_Next;
1026  erase_after(_Next, end());
1027  }
1028  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
Definition: xutility:563
void _Insert_after(const_iterator _Where, _Valty &&..._Val)
Definition: forward_list:896
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
size_type _Size() const
Definition: forward_list:1461
const_iterator _Before_end() const
Definition: forward_list:1469
iterator end() _NOEXCEPT
Definition: forward_list:982
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: forward_list:734
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153
_Mybase::const_iterator const_iterator
Definition: forward_list:742
#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
1031  { // determine new length, padding with _Val elements as needed
1032  size_type _Cursize = _Size();
1033  if (_Cursize < _Newsize)
1034  _Insert_n_after(_Before_end(), _Newsize - _Cursize, _Val);
1035  else if (_Newsize < _Cursize)
1036  { // erase all but _Newsize elements
1037  iterator _Next = before_begin();
1038  for (; 0 < _Newsize; --_Newsize)
1039  ++_Next;
1040  erase_after(_Next, end());
1041  }
1042  }
Definition: xutility:563
_In_ int _Val
Definition: vcruntime_string.h:62
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
size_type _Size() const
Definition: forward_list:1461
const_iterator _Before_end() const
Definition: forward_list:1469
iterator end() _NOEXCEPT
Definition: forward_list:982
_Mybase::size_type size_type
Definition: forward_list:734
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153
iterator _Insert_n_after(const_iterator _Where, size_type _Count, const _Ty &_Val)
Definition: forward_list:1529
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::reverse ( )
inline
1451  { // reverse sequence
1452  if (!empty())
1453  { // worth doing, move to back in reverse order
1454  const_iterator _First = _Before_end();
1455  for (; begin() != _First; )
1456  _Splice_same_after(_First, *this, before_begin(), ++begin());
1457  }
1458  }
void _Splice_same_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1505
bool empty() const _NOEXCEPT
Definition: forward_list:1049
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
iterator begin() _NOEXCEPT
Definition: forward_list:972
const_iterator _Before_end() const
Definition: forward_list:1469
_Mybase::const_iterator const_iterator
Definition: forward_list:742
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::sort ( )
inline
1404  { // order sequence, using operator<
1405  sort(less<>());
1406  }
void sort()
Definition: forward_list:1403
Definition: xstddef:231
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::sort ( _Pr2  _Pred)
inline
1410  { // order sequence, using _Pred
1411  _Sort(before_begin(), end(), _Pred, _STD distance(begin(), end()));
1412  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
iterator before_begin() _NOEXCEPT
Definition: forward_list:957
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1124
iterator begin() _NOEXCEPT
Definition: forward_list:972
iterator end() _NOEXCEPT
Definition: forward_list:982
void _Sort(iterator _Before_first, iterator _Last, _Pr2 &_Pred, size_type _Size)
Definition: forward_list:1415
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt _Right 
)
inline
1236  { // splice all of _Right after _Where
1237  if (this != &_Right && !_Right.empty())
1238  { // worth splicing, do it
1239  _Splice_after(_Where, _Right,
1240  _Right.before_begin(), _Right.end());
1241  }
1242  }
void _Splice_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1477
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt &&  _Right 
)
inline
1245  { // splice all of _Right at _Where
1246  splice_after(_Where, (_Myt&)_Right);
1247  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:727
void splice_after(const_iterator _Where, _Myt &_Right)
Definition: forward_list:1235
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt _Right,
const_iterator  _First 
)
inline
1251  { // splice _Right (_First, _First + 2) after _Where
1252  const_iterator _After = _First;
1253  if (_First == _Right.end() || ++_After == _Right.end())
1254  _DEBUG_ERROR("forward_list splice_after iterator outside range");
1255  else
1256  { // element exists, try splice
1257  if (this != &_Right
1258  || (_Where != _First && _Where != _After))
1259  _Splice_after(_Where, _Right, _First, ++_After);
1260  }
1261  }
void _Splice_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1477
_Mybase::const_iterator const_iterator
Definition: forward_list:742
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::splice_after ( const_iterator  _Where,
_Myt &&  _Right,
const_iterator  _First 
)
inline
1265  { // splice _Right [_First, _First + 1) at _Where
1266  splice_after(_Where, (_Myt&)_Right, _First);
1267  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:727
void splice_after(const_iterator _Where, _Myt &_Right)
Definition: forward_list:1235
constexpr const _Ty &() _Right
Definition: algorithm:3591
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  const_iterator _After = _First;
1273  if (_First == _Right.end())
1274  _DEBUG_ERROR("forward_list splice_after iterator outside range");
1275  else if (++_After != _Last && (this != &_Right || _Where != _First))
1276  _Splice_after(_Where, _Right, _First, _Last);
1277  }
void _Splice_after(const_iterator _Where, _Myt &_Right, const_iterator _First, const_iterator _Last)
Definition: forward_list:1477
_Mybase::const_iterator const_iterator
Definition: forward_list:742
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt _Last
Definition: algorithm:1936
constexpr const _Ty &() _Right
Definition: algorithm:3591
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
1281  { // splice _Right [_First, _Last) at _Where
1282  splice_after(_Where, (_Myt&)_Right, _First, _Last);
1283  }
forward_list< _Ty, _Alloc > _Myt
Definition: forward_list:727
void splice_after(const_iterator _Where, _Myt &_Right)
Definition: forward_list:1235
_FwdIt _Last
Definition: algorithm:1936
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::swap ( _Myt _Right)
inline
1226  { // exchange contents with _Right
1227  if (this != &_Right)
1228  { // (maybe) swap allocators, swap control information
1229  _Pocs(this->_Getal(), _Right._Getal());
1230  this->_Swap_all(_Right);
1231  _Swap_adl(this->_Myhead(), _Right._Myhead());
1232  }
1233  }
_Alty & _Getal() _NOEXCEPT
Definition: forward_list:613
_Nodeptr & _Myhead() _NOEXCEPT
Definition: forward_list:633
void _Swap_all(_Myt &_Right)
Definition: forward_list:608
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:56
void _Pocs(_Alty &_Left, _Alty &_Right, true_type) _NOEXCEPT
Definition: xmemory0:1069
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty, class _Alloc = allocator<_Ty>>
void forward_list< _Ty, _Alloc >::unique ( )
inline
1332  { // erase each element matching previous
1333  unique(equal_to<>());
1334  }
Definition: xstddef:217
void unique()
Definition: forward_list:1331
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Pr2 >
void forward_list< _Ty, _Alloc >::unique ( _Pr2  _Pred)
inline
1338  { // erase each element satisfying _Pred with previous
1339  iterator _First = begin();
1340  if (_First != end())
1341  { // worth doing
1342  iterator _After = _First;
1343  for (++_After; _After != end(); )
1344  if (_Pred(*_First, *_After))
1345  _After = erase_after(_First);
1346  else
1347  _First = _After++;
1348  }
1349  }
_FwdIt const _Ty _Pr _Pred
Definition: algorithm:1985
Definition: xutility:563
iterator begin() _NOEXCEPT
Definition: forward_list:972
iterator end() _NOEXCEPT
Definition: forward_list:982
iterator erase_after(const_iterator _Where)
Definition: forward_list:1153

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