STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Protected Member Functions | List of all members
vector< _Ty, _Alloc > Class Template Reference
Inheritance diagram for vector< _Ty, _Alloc >:
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Vector_val< _Vec_base_types< _Ty, _Alloc >::_Val_types > _Container_base0

Public Types

typedef vector< _Ty, _Alloc_Myt
 
typedef _Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
 
typedef _Alloc allocator_type
 
typedef _Mybase::_Alty _Alty
 
typedef _Mybase::value_type value_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::iterator iterator
 
typedef _Mybase::const_iterator const_iterator
 
typedef _STD reverse_iterator< iteratorreverse_iterator
 
typedef _STD reverse_iterator< const_iteratorconst_reverse_iterator
 
- Public Types inherited from _Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > >
typedef _Vector_alloc< _Al_has_storage, _Vec_base_types< _Ty, _Alloc > > _Myt
 
typedef _Vec_base_types< _Ty, _Alloc >::_Alloc _Alloc
 
typedef _Vec_base_types< _Ty, _Alloc >::_Alty _Alty
 
- Public Types inherited from _Vector_val< _Vec_base_types< _Ty, _Alloc >::_Val_types >
typedef _Vector_val< _Vec_base_types< _Ty, _Alloc >::_Val_types > _Myt
 
typedef _Vec_base_types< _Ty, _Alloc >::_Val_types::value_type value_type
 
typedef _Vec_base_types< _Ty, _Alloc >::_Val_types::size_type size_type
 
typedef _Vec_base_types< _Ty, _Alloc >::_Val_types::difference_type difference_type
 
typedef _Vec_base_types< _Ty, _Alloc >::_Val_types::pointer pointer
 
typedef _Vec_base_types< _Ty, _Alloc >::_Val_types::const_pointer const_pointer
 
typedef _Vec_base_types< _Ty, _Alloc >::_Val_types::reference reference
 
typedef _Vec_base_types< _Ty, _Alloc >::_Val_types::const_reference const_reference
 
typedef _Vector_iterator< _Mytiterator
 
typedef _Vector_const_iterator< _Mytconst_iterator
 

Public Member Functions

 vector ()
 
 vector (const _Alloc &_Al)
 
 vector (size_type _Count)
 
 vector (size_type _Count, const value_type &_Val)
 
 vector (size_type _Count, const value_type &_Val, const _Alloc &_Al)
 
 vector (const _Myt &_Right)
 
 vector (const _Myt &_Right, const _Alloc &_Al)
 
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>:: type>
 vector (_Iter _First, _Iter _Last)
 
template<class _Iter , class = typename enable_if<_Is_iterator<_Iter>::value, void>:: type>
 vector (_Iter _First, _Iter _Last, const _Alloc &_Al)
 
template<class _Iter >
void _Construct (_Iter _First, _Iter _Last)
 
template<class _Iter >
void _Construct (_Iter _First, _Iter _Last, input_iterator_tag)
 
template<class _Iter >
void _Construct (_Iter _First, _Iter _Last, forward_iterator_tag)
 
void _Construct_n (size_type _Count, const value_type *_Pval)
 
 vector (_Myt &&_Right)
 
 vector (_Myt &&_Right, const _Alloc &_Al)
 
_Mytoperator= (_Myt &&_Right)
 
void _Assign_rv (_Myt &&_Right, true_type)
 
void _Assign_rv (_Myt &&_Right, false_type)
 
void _Assign_rv (_Myt &&_Right)
 
void push_back (value_type &&_Val)
 
iterator insert (const_iterator _Where, _Ty &&_Val)
 
template<class... _Valty>
void emplace_back (_Valty &&..._Val)
 
template<class... _Valty>
iterator emplace (const_iterator _Where, _Valty &&..._Val)
 
 vector (_XSTD initializer_list< value_type > _Ilist, const _Alloc &_Al=allocator_type())
 
_Mytoperator= (_XSTD initializer_list< value_type > _Ilist)
 
void assign (_XSTD initializer_list< value_type > _Ilist)
 
iterator insert (const_iterator _Where, _XSTD initializer_list< value_type > _Ilist)
 
 ~vector () _NOEXCEPT
 
_Mytoperator= (const _Myt &_Right)
 
void reserve (size_type _Count)
 
size_type capacity () const _NOEXCEPT
 
size_type _Unused_capacity () const _NOEXCEPT
 
size_type _Has_unused_capacity () 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
 
reverse_iterator rbegin () _NOEXCEPT
 
const_reverse_iterator rbegin () const _NOEXCEPT
 
reverse_iterator rend () _NOEXCEPT
 
const_reverse_iterator rend () const _NOEXCEPT
 
const_iterator cbegin () const _NOEXCEPT
 
const_iterator cend () const _NOEXCEPT
 
const_reverse_iterator crbegin () const _NOEXCEPT
 
const_reverse_iterator crend () const _NOEXCEPT
 
void shrink_to_fit ()
 
void resize (size_type _Newsize)
 
void resize (size_type _Newsize, const value_type &_Val)
 
size_type size () const _NOEXCEPT
 
size_type max_size () const _NOEXCEPT
 
bool empty () const _NOEXCEPT
 
_Alloc get_allocator () const _NOEXCEPT
 
const_reference at (size_type _Pos) const
 
reference at (size_type _Pos)
 
const_reference operator[] (size_type _Pos) const
 
reference operator[] (size_type _Pos)
 
pointer data () _NOEXCEPT
 
const_pointer data () const _NOEXCEPT
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void push_back (const value_type &_Val)
 
void pop_back ()
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, void >::type assign (_Iter _First, _Iter _Last)
 
template<class _Iter >
void _Assign (_Iter _First, _Iter _Last, input_iterator_tag)
 
template<class _Iter >
void _Assign (_Iter _First, _Iter _Last, forward_iterator_tag)
 
void assign (size_type _Count, const value_type &_Val)
 
iterator insert (const_iterator _Where, const _Ty &_Val)
 
iterator insert (const_iterator _Where, size_type _Count, const _Ty &_Val)
 
template<class _Iter >
enable_if< _Is_iterator< _Iter >::value, iterator >::type insert (const_iterator _Where, _Iter _First, _Iter _Last)
 
template<class _Iter >
void _Insert (const_iterator _Where, _Iter _First, _Iter _Last, input_iterator_tag)
 
template<class _Iter >
void _Insert (const_iterator _Where, _Iter _First, _Iter _Last, forward_iterator_tag)
 
iterator erase (const_iterator _Where)
 
iterator erase (const_iterator _First_arg, const_iterator _Last_arg)
 
void _Pop_back_n (size_type _Count)
 
void clear () _NOEXCEPT
 
void swap (_Myt &_Right)
 
- Public Member Functions inherited from _Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > >
 _Vector_alloc (const _Alloc &_Al=_Alloc())
 
void _Change_alloc (const _Alty &_Al)
 
void _Swap_alloc (_Myt &_Right)
 
_Alty_Getal ()
 
const _Alty_Getal () const
 
- Public Member Functions inherited from _Vector_val< _Vec_base_types< _Ty, _Alloc >::_Val_types >
 _Vector_val ()
 
- Public Member Functions inherited from _Container_base0
void _Orphan_all ()
 
void _Swap_all (_Container_base0 &)
 

Protected Member Functions

bool _Buy (size_type _Capacity)
 
void _Destroy (pointer _First, pointer _Last)
 
size_type _Grow_to (size_type _Count) const
 
bool _Inside (const value_type *_Ptr) const
 
void _Reallocate (size_type _Count)
 
void _Reserve (size_type _Count)
 
void _Tidy ()
 
template<class _Iter >
pointer _Ucopy (_Iter _First, _Iter _Last, pointer _Ptr)
 
template<class _Iter >
pointer _Umove (_Iter _First, _Iter _Last, pointer _Ptr)
 
iterator _Insert_n (const_iterator _Where, size_type _Count, const value_type &_Val)
 
pointer _Ufill (pointer _Ptr, size_type _Count, const value_type *_Pval)
 
 __declspec (noreturn) void _Xlen() const
 
 __declspec (noreturn) void _Xran() const
 
void _Orphan_range (pointer, pointer) const
 

Additional Inherited Members

- Public Attributes inherited from _Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > >
_Vec_base_types< _Ty, _Alloc >::_Alty _Alval
 
- Public Attributes inherited from _Vector_val< _Vec_base_types< _Ty, _Alloc >::_Val_types >
pointer _Myfirst
 
pointer _Mylast
 
pointer _Myend
 

Member Typedef Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::_Alty vector< _Ty, _Alloc >::_Alty
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Vector_alloc<!is_empty<_Alloc>::value, _Vec_base_types<_Ty, _Alloc> > vector< _Ty, _Alloc >::_Mybase
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef vector<_Ty, _Alloc> vector< _Ty, _Alloc >::_Myt
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Alloc vector< _Ty, _Alloc >::allocator_type
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::const_iterator vector< _Ty, _Alloc >::const_iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::const_pointer vector< _Ty, _Alloc >::const_pointer
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::const_reference vector< _Ty, _Alloc >::const_reference
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _STD reverse_iterator<const_iterator> vector< _Ty, _Alloc >::const_reverse_iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::difference_type vector< _Ty, _Alloc >::difference_type
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::iterator vector< _Ty, _Alloc >::iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::pointer vector< _Ty, _Alloc >::pointer
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::reference vector< _Ty, _Alloc >::reference
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _STD reverse_iterator<iterator> vector< _Ty, _Alloc >::reverse_iterator
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::size_type vector< _Ty, _Alloc >::size_type
template<class _Ty, class _Alloc = allocator<_Ty>>
typedef _Mybase::value_type vector< _Ty, _Alloc >::value_type

Constructor & Destructor Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( )
inline
679  : _Mybase()
680  { // construct empty vector
681  }
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( const _Alloc _Al)
inlineexplicit
684  : _Mybase(_Al)
685  { // construct empty vector, allocator
686  }
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( size_type  _Count)
inlineexplicit
689  : _Mybase()
690  { // construct from _Count * value_type()
691  if (_Buy(_Count))
692  { // nonzero, fill it
693  _Alty _Alval(this->_Getal());
694  _TRY_BEGIN
696  this->_Mylast += _Count;
697  _CATCH_ALL
698  _Tidy();
699  _RERAISE;
700  _CATCH_END
701  }
702  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
void _Uninitialized_default_fill_n(_FwdIt _First, _Diff _Count, _Alloc &_Al)
Definition: xmemory:688
bool _Buy(size_type _Capacity)
Definition: vector:1545
#define _CATCH_ALL
Definition: xstddef:62
_Vec_base_types< _Ty, _Alloc >::_Alty _Alval
Definition: vector:499
_Mybase::_Alty _Alty
Definition: vector:659
_Diff _Count
Definition: algorithm:1941
#define _RERAISE
Definition: xstddef:74
void _Tidy()
Definition: vector:1621
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( size_type  _Count,
const value_type _Val 
)
inline
705  : _Mybase()
706  { // construct from _Count * _Val
708  }
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
void _Construct_n(size_type _Count, const value_type *_Pval)
Definition: vector:797
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( size_type  _Count,
const value_type _Val,
const _Alloc _Al 
)
inline
711  : _Mybase(_Al)
712  { // construct from _Count * _Val, allocator
714  }
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
void _Construct_n(size_type _Count, const value_type *_Pval)
Definition: vector:797
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( const _Myt _Right)
inline
718  : _Mybase(_Right._Getal().select_on_container_copy_construction())
719 
720 
721  { // construct by copying _Right
722  if (_Buy(_Right.size()))
723  _TRY_BEGIN
724  this->_Mylast = _Ucopy(_Right.begin(), _Right.end(),
725  this->_Myfirst);
726  _CATCH_ALL
727  _Tidy();
728  _RERAISE;
729  _CATCH_END
730  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
bool _Buy(size_type _Capacity)
Definition: vector:1545
#define _CATCH_ALL
Definition: xstddef:62
#define _RERAISE
Definition: xstddef:74
void _Tidy()
Definition: vector:1621
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
pointer _Ucopy(_Iter _First, _Iter _Last, pointer _Ptr)
Definition: vector:1636
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( const _Myt _Right,
const _Alloc _Al 
)
inline
733  : _Mybase(_Al)
734  { // construct by copying _Right, allocator
735  if (_Buy(_Right.size()))
736  _TRY_BEGIN
737  this->_Mylast = _Ucopy(_Right.begin(), _Right.end(),
738  this->_Myfirst);
739  _CATCH_ALL
740  _Tidy();
741  _RERAISE;
742  _CATCH_END
743  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
bool _Buy(size_type _Capacity)
Definition: vector:1545
#define _CATCH_ALL
Definition: xstddef:62
#define _RERAISE
Definition: xstddef:74
void _Tidy()
Definition: vector:1621
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
pointer _Ucopy(_Iter _First, _Iter _Last, pointer _Ptr)
Definition: vector:1636
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>
vector< _Ty, _Alloc >::vector ( _Iter  _First,
_Iter  _Last 
)
inline
749  : _Mybase()
750  { // construct from [_First, _Last)
751  _Construct(_First, _Last);
752  }
void _Construct(_Iter _First, _Iter _Last)
Definition: vector:764
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
_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>
vector< _Ty, _Alloc >::vector ( _Iter  _First,
_Iter  _Last,
const _Alloc _Al 
)
inline
758  : _Mybase(_Al)
759  { // construct from [_First, _Last) with allocator
760  _Construct(_First, _Last);
761  }
void _Construct(_Iter _First, _Iter _Last)
Definition: vector:764
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( _Myt &&  _Right)
inline
811  : _Mybase(_Right._Getal())
812  { // construct by moving _Right
813  _Assign_rv(_STD forward<_Myt>(_Right), true_type());
814  }
void _Assign_rv(_Myt &&_Right, true_type)
Definition: vector:836
integral_constant< bool, true > true_type
Definition: xtr1common:47
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( _Myt &&  _Right,
const _Alloc _Al 
)
inline
817  : _Mybase(_Al)
818  { // construct by moving _Right, allocator
819  _Assign_rv(_STD forward<_Myt>(_Right));
820  }
void _Assign_rv(_Myt &&_Right, true_type)
Definition: vector:836
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::vector ( _XSTD initializer_list< value_type _Ilist,
const _Alloc _Al = allocator_type() 
)
inline
921  : _Mybase(_Al)
922  { // construct from initializer_list
923  insert(begin(), _Ilist.begin(), _Ilist.end());
924  }
iterator begin() _NOEXCEPT
Definition: vector:1023
iterator insert(const_iterator _Where, _Ty &&_Val)
Definition: vector:887
_Vector_alloc<!is_empty< _Alloc >::value, _Vec_base_types< _Ty, _Alloc > > _Mybase
Definition: vector:656
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::~vector ( )
inline
944  { // destroy the object
945  _Tidy();
946  }
void _Tidy()
Definition: vector:1621

Member Function Documentation

template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::__declspec ( noreturn  ) const
inlineprotected
1753  { // report a length_error
1754  _Xlength_error("vector<T> too long");
1755  }
template<class _Ty, class _Alloc = allocator<_Ty>>
vector< _Ty, _Alloc >::__declspec ( noreturn  ) const
inlineprotected
1758  { // report an out_of_range error
1759  _Xout_of_range("invalid vector<T> subscript");
1760  }
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void vector< _Ty, _Alloc >::_Assign ( _Iter  _First,
_Iter  _Last,
input_iterator_tag   
)
inline
1297  { // assign [_First, _Last), input iterators
1298  for (; _First != _Last; ++_First)
1299  emplace_back(*_First);
1300  }
void emplace_back(_Valty &&..._Val)
Definition: vector:893
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void vector< _Ty, _Alloc >::_Assign ( _Iter  _First,
_Iter  _Last,
forward_iterator_tag   
)
inline
1304  { // assign [_First, _Last), forward iterators
1305  if (_First == _Last)
1306  return; // nothing to do
1307 
1308  size_type _Newsize = _STD distance(_First, _Last);
1309 
1310  if (capacity() < _Newsize)
1311  { // need more room, try to get it
1312  size_type _Newcapacity = _Grow_to(_Newsize);
1313  _Tidy();
1314  _Buy(_Newcapacity);
1315  }
1316 
1317  this->_Mylast = _Ucopy(_First, _Last, this->_Myfirst);
1318  }
iterator_traits< _InIt >::difference_type distance(_InIt _First, _InIt _Last)
Definition: xutility:755
size_type capacity() const _NOEXCEPT
Definition: vector:1008
bool _Buy(size_type _Capacity)
Definition: vector:1545
_Mybase::size_type size_type
Definition: vector:662
size_type _Grow_to(size_type _Count) const
Definition: vector:1570
void _Tidy()
Definition: vector:1621
pointer _Ucopy(_Iter _First, _Iter _Last, pointer _Ptr)
Definition: vector:1636
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Assign_rv ( _Myt &&  _Right,
true_type   
)
inline
837  { // move from _Right, stealing its contents
838  this->_Swap_all((_Myt&)_Right);
839  this->_Myfirst = _Right._Myfirst;
840  this->_Mylast = _Right._Mylast;
841  this->_Myend = _Right._Myend;
842 
843  _Right._Myfirst = pointer();
844  _Right._Mylast = pointer();
845  _Right._Myend = pointer();
846  }
vector< _Ty, _Alloc > _Myt
Definition: vector:654
void _Swap_all(_Container_base0 &)
Definition: xutility:46
_Mybase::pointer pointer
Definition: vector:664
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Assign_rv ( _Myt &&  _Right,
false_type   
)
inline
849  { // move from _Right, possibly moving its contents
850  if (get_allocator() == _Right.get_allocator())
851  _Assign_rv(_STD forward<_Myt>(_Right), true_type());
852  else
855  }
_Alloc get_allocator() const _NOEXCEPT
Definition: vector:1161
void _Construct(_Iter _First, _Iter _Last)
Definition: vector:764
void _Assign_rv(_Myt &&_Right, true_type)
Definition: vector:836
integral_constant< bool, true > true_type
Definition: xtr1common:47
move_iterator< _RanIt > make_move_iterator(_RanIt _Iter)
Definition: xutility:2033
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Assign_rv ( _Myt &&  _Right)
inline
858  { // assign by moving _Right
859  _Assign_rv(_STD forward<_Myt>(_Right),
860  typename _Alty::propagate_on_container_move_assignment());
861  }
void _Assign_rv(_Myt &&_Right, true_type)
Definition: vector:836
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
bool vector< _Ty, _Alloc >::_Buy ( size_type  _Capacity)
inlineprotected
1546  { // allocate array with _Capacity elements
1547  this->_Myfirst = pointer();
1548  this->_Mylast = pointer();
1549  this->_Myend = pointer();
1550 
1551  if (_Capacity == 0)
1552  return (false);
1553  else if (max_size() < _Capacity)
1554  _Xlen(); // result too long
1555  else
1556  { // nonempty array, allocate storage
1557  this->_Myfirst = this->_Getal().allocate(_Capacity);
1558  this->_Mylast = this->_Myfirst;
1559  this->_Myend = this->_Myfirst + _Capacity;
1560  }
1561  return (true);
1562  }
size_type max_size() const _NOEXCEPT
Definition: vector:1151
_Mybase::pointer pointer
Definition: vector:664
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void vector< _Ty, _Alloc >::_Construct ( _Iter  _First,
_Iter  _Last 
)
inline
765  { // initialize with [_First, _Last)
766  _Construct(_First, _Last, _Iter_cat(_First));
767  }
iterator_traits< _Iter >::iterator_category _Iter_cat(const _Iter &)
Definition: xutility:404
void _Construct(_Iter _First, _Iter _Last)
Definition: vector:764
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void vector< _Ty, _Alloc >::_Construct ( _Iter  _First,
_Iter  _Last,
input_iterator_tag   
)
inline
771  { // initialize with [_First, _Last), input iterators
772  _TRY_BEGIN
773 
774  for (; _First != _Last; ++_First)
775  emplace_back(*_First);
776 
777  _CATCH_ALL
778  _Tidy();
779  _RERAISE;
780  _CATCH_END
781  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
void emplace_back(_Valty &&..._Val)
Definition: vector:893
#define _CATCH_ALL
Definition: xstddef:62
#define _RERAISE
Definition: xstddef:74
void _Tidy()
Definition: vector:1621
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void vector< _Ty, _Alloc >::_Construct ( _Iter  _First,
_Iter  _Last,
forward_iterator_tag   
)
inline
785  { // initialize with [_First, _Last), forward iterators
786  if (_Buy(_STD distance(_First, _Last)))
787  { // nonzero, fill it
788  _TRY_BEGIN
789  this->_Mylast = _Ucopy(_First, _Last, this->_Myfirst);
790  _CATCH_ALL
791  _Tidy();
792  _RERAISE;
793  _CATCH_END
794  }
795  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
iterator_traits< _InIt >::difference_type distance(_InIt _First, _InIt _Last)
Definition: xutility:755
bool _Buy(size_type _Capacity)
Definition: vector:1545
#define _CATCH_ALL
Definition: xstddef:62
#define _RERAISE
Definition: xstddef:74
void _Tidy()
Definition: vector:1621
pointer _Ucopy(_Iter _First, _Iter _Last, pointer _Ptr)
Definition: vector:1636
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Construct_n ( size_type  _Count,
const value_type _Pval 
)
inline
798  { // construct from _Count * *_Pval
799  if (_Buy(_Count))
800  { // nonzero, fill it
801  _TRY_BEGIN
802  this->_Mylast = _Ufill(this->_Myfirst, _Count, _Pval);
803  _CATCH_ALL
804  _Tidy();
805  _RERAISE;
806  _CATCH_END
807  }
808  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
bool _Buy(size_type _Capacity)
Definition: vector:1545
#define _CATCH_ALL
Definition: xstddef:62
_Diff _Count
Definition: algorithm:1941
pointer _Ufill(pointer _Ptr, size_type _Count, const value_type *_Pval)
Definition: vector:1745
#define _RERAISE
Definition: xstddef:74
void _Tidy()
Definition: vector:1621
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Destroy ( pointer  _First,
pointer  _Last 
)
inlineprotected
1565  { // destroy [_First, _Last) using allocator
1566  _Alty _Alval(this->_Getal());
1567  _Destroy_range(_First, _Last, _Alval);
1568  }
void _Destroy_range(typename _Alloc::pointer _First, typename _Alloc::pointer _Last, _Alloc &_Al, _Nonscalar_ptr_iterator_tag)
Definition: xmemory0:77
_Vec_base_types< _Ty, _Alloc >::_Alty _Alval
Definition: vector:499
_Mybase::_Alty _Alty
Definition: vector:659
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type vector< _Ty, _Alloc >::_Grow_to ( size_type  _Count) const
inlineprotected
1571  { // grow by 50% or at least to _Count
1572  size_type _Capacity = capacity();
1573 
1574  _Capacity = max_size() - _Capacity / 2 < _Capacity
1575  ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
1576  if (_Capacity < _Count)
1577  _Capacity = _Count;
1578  return (_Capacity);
1579  }
size_type capacity() const _NOEXCEPT
Definition: vector:1008
size_type max_size() const _NOEXCEPT
Definition: vector:1151
_Mybase::size_type size_type
Definition: vector:662
_Diff _Count
Definition: algorithm:1941
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type vector< _Ty, _Alloc >::_Has_unused_capacity ( ) const
inline
1019  { // micro-optimization for capacity() != size()
1020  return (this->_Myend != this->_Mylast);
1021  }
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void vector< _Ty, _Alloc >::_Insert ( const_iterator  _Where,
_Iter  _First,
_Iter  _Last,
input_iterator_tag   
)
inline
1350  { // insert [_First, _Last) at _Where, input iterators
1351  size_type _Off = _VIPTR(_Where) - this->_Myfirst;
1352 
1353  #if _ITERATOR_DEBUG_LEVEL == 2
1354  if (size() < _Off)
1355  _DEBUG_ERROR("vector insert iterator outside range");
1356  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1357 
1358  if (_First != _Last)
1359  { // worth doing, gather at end and rotate into place
1360  size_type _Oldsize = size();
1361 
1362  _TRY_BEGIN
1363  for (; _First != _Last; ++_First)
1364  push_back(*_First); // append
1365 
1366  _CATCH_ALL
1367  erase(begin() + _Oldsize, end());
1368  _RERAISE;
1369  _CATCH_END
1370 
1371  _STD rotate(begin() + _Off, begin() + _Oldsize, end());
1372  }
1373  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
#define _VIPTR(it)
Definition: vector:670
iterator begin() _NOEXCEPT
Definition: vector:1023
size_type size() const _NOEXCEPT
Definition: vector:1146
_FwdIt rotate(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last)
Definition: xutility:3239
iterator end() _NOEXCEPT
Definition: vector:1033
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: vector:662
iterator erase(const_iterator _Where)
Definition: vector:1451
void push_back(value_type &&_Val)
Definition: vector:864
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
#define _RERAISE
Definition: xstddef:74
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
void vector< _Ty, _Alloc >::_Insert ( const_iterator  _Where,
_Iter  _First,
_Iter  _Last,
forward_iterator_tag   
)
inline
1378  { // insert [_First, _Last) at _Where, forward iterators
1379  #if _ITERATOR_DEBUG_LEVEL == 2
1380  if (_VICONT(_Where) != this
1381  || _VIPTR(_Where) < this->_Myfirst
1382  || this->_Mylast < _VIPTR(_Where))
1383  _DEBUG_ERROR("vector insert iterator outside range");
1384  _DEBUG_RANGE(_First, _Last);
1385  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1386 
1387  size_type _Count = 0;
1388  _Distance(_First, _Last, _Count);
1389 
1390  if (_Count == 0)
1391  ;
1392  else if (_Unused_capacity() < _Count)
1393  { // not enough room, reallocate
1394  if (max_size() - size() < _Count)
1395  _Xlen(); // result too long
1396 
1397  size_type _Capacity = _Grow_to(size() + _Count);
1398  pointer _Newvec = this->_Getal().allocate(_Capacity);
1399  pointer _Ptr = _Newvec;
1400 
1401  _TRY_BEGIN
1402  _Ptr = _Umove(this->_Myfirst, _VIPTR(_Where),
1403  _Newvec); // copy prefix
1404  _Ptr = _Ucopy(_First, _Last, _Ptr); // add new stuff
1405  _Umove(_VIPTR(_Where), this->_Mylast,
1406  _Ptr); // copy suffix
1407  _CATCH_ALL
1408  _Destroy(_Newvec, _Ptr);
1409  this->_Getal().deallocate(_Newvec, _Capacity);
1410  _RERAISE;
1411  _CATCH_END
1412 
1413  _Count += size();
1414  if (this->_Myfirst != pointer())
1415  { // destroy and deallocate old array
1416  _Destroy(this->_Myfirst, this->_Mylast);
1417  this->_Getal().deallocate(this->_Myfirst,
1418  this->_Myend - this->_Myfirst);
1419  }
1420 
1421  this->_Orphan_all();
1422  this->_Myend = _Newvec + _Capacity;
1423  this->_Mylast = _Newvec + _Count;
1424  this->_Myfirst = _Newvec;
1425  }
1426  else
1427  { // new stuff fits, append and rotate into place
1428  _Ucopy(_First, _Last, this->_Mylast);
1429  _STD rotate(_VIPTR(_Where), this->_Mylast,
1430  this->_Mylast + _Count);
1431  this->_Mylast += _Count;
1432  _Orphan_range(_VIPTR(_Where), this->_Mylast);
1433  }
1434  }
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
void _Distance(_InIt _First, _InIt _Last, _Diff &_Off)
Definition: xutility:764
void _Orphan_all()
Definition: xutility:42
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
#define _VIPTR(it)
Definition: vector:670
#define _VICONT(it)
Definition: vector:669
pointer _Umove(_Iter _First, _Iter _Last, pointer _Ptr)
Definition: vector:1644
size_type size() const _NOEXCEPT
Definition: vector:1146
_FwdIt rotate(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last)
Definition: xutility:3239
size_type max_size() const _NOEXCEPT
Definition: vector:1151
void _Orphan_range(pointer, pointer) const
Definition: vector:1779
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: vector:662
size_type _Unused_capacity() const _NOEXCEPT
Definition: vector:1013
void _Destroy(pointer _First, pointer _Last)
Definition: vector:1564
size_type _Grow_to(size_type _Count) const
Definition: vector:1570
_Diff _Count
Definition: algorithm:1941
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_Mybase::pointer pointer
Definition: vector:664
#define _RERAISE
Definition: xstddef:74
pointer _Ucopy(_Iter _First, _Iter _Last, pointer _Ptr)
Definition: vector:1636
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::_Insert_n ( const_iterator  _Where,
size_type  _Count,
const value_type _Val 
)
inlineprotected
1653  { // insert _Count * _Val at _Where
1654  #if _ITERATOR_DEBUG_LEVEL == 2
1655  if (_VICONT(_Where) != this
1656  || _VIPTR(_Where) < this->_Myfirst
1657  || this->_Mylast < _VIPTR(_Where))
1658  _DEBUG_ERROR("vector insert iterator outside range");
1659  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1660 
1661  size_type _Off = _VIPTR(_Where) - this->_Myfirst;
1662  if (_Count == 0)
1663  ;
1664  else if (_Unused_capacity() < _Count)
1665  { // not enough room, reallocate
1666  if (max_size() - size() < _Count)
1667  _Xlen(); // result too long
1668 
1669  size_type _Capacity = _Grow_to(size() + _Count);
1670  pointer _Newvec = this->_Getal().allocate(_Capacity);
1671  size_type _Whereoff = _VIPTR(_Where) - this->_Myfirst;
1672  int _Ncopied = 0;
1673 
1674  _TRY_BEGIN
1675  _Ufill(_Newvec + _Whereoff, _Count,
1676  _STD addressof(_Val)); // add new stuff
1677  ++_Ncopied;
1678  _Umove(this->_Myfirst, _VIPTR(_Where),
1679  _Newvec); // copy prefix
1680  ++_Ncopied;
1681  _Umove(_VIPTR(_Where), this->_Mylast,
1682  _Newvec + (_Whereoff + _Count)); // copy suffix
1683  _CATCH_ALL
1684  if (1 < _Ncopied)
1685  _Destroy(_Newvec, _Newvec + _Whereoff);
1686  if (0 < _Ncopied)
1687  _Destroy(_Newvec + _Whereoff, _Newvec + _Whereoff + _Count);
1688  this->_Getal().deallocate(_Newvec, _Capacity);
1689  _RERAISE;
1690  _CATCH_END
1691 
1692  _Count += size();
1693  if (this->_Myfirst != pointer())
1694  { // destroy and deallocate old array
1695  _Destroy(this->_Myfirst, this->_Mylast);
1696  this->_Getal().deallocate(this->_Myfirst,
1697  this->_Myend - this->_Myfirst);
1698  }
1699 
1700  this->_Orphan_all();
1701  this->_Myend = _Newvec + _Capacity;
1702  this->_Mylast = _Newvec + _Count;
1703  this->_Myfirst = _Newvec;
1704  }
1705  else if ((size_type)(this->_Mylast - _VIPTR(_Where))
1706  < _Count)
1707  { // new stuff spills off end
1708  value_type _Tmp = _Val; // in case _Val is in sequence
1709 
1710  _Umove(_VIPTR(_Where), this->_Mylast,
1711  _VIPTR(_Where) + _Count); // copy suffix
1712 
1713  _TRY_BEGIN
1714  _Ufill(this->_Mylast,
1715  _Count - (this->_Mylast - _VIPTR(_Where)),
1716  _STD addressof(_Tmp)); // insert new stuff off end
1717  _CATCH_ALL
1718  _Destroy(_VIPTR(_Where) + _Count,
1719  this->_Mylast + _Count);
1720  _RERAISE;
1721  _CATCH_END
1722 
1723  this->_Mylast += _Count;
1724  _Orphan_range(_VIPTR(_Where), this->_Mylast);
1725  _STD fill(_VIPTR(_Where), this->_Mylast - _Count,
1726  _Tmp); // insert up to old end
1727  }
1728  else
1729  { // new stuff can all be assigned
1730  value_type _Tmp = _Val; // in case _Val is in sequence
1731 
1732  pointer _Oldend = this->_Mylast;
1733  this->_Mylast = _Umove(_Oldend - _Count, _Oldend,
1734  this->_Mylast); // copy suffix
1735 
1736  _Orphan_range(_VIPTR(_Where), this->_Mylast);
1737  _Copy_backward(_VIPTR(_Where), _Oldend - _Count,
1738  _Oldend); // copy hole
1739  _STD fill(_VIPTR(_Where),
1740  _VIPTR(_Where) + _Count, _Tmp); // insert into hole
1741  }
1742  return (begin() + _Off);
1743  }
_BidIt2 _Copy_backward(_BidIt1 _First, _BidIt1 _Last, _BidIt2 _Dest, _Nonscalar_ptr_iterator_tag)
Definition: xutility:2342
void _Orphan_all()
Definition: xutility:42
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
#define _VIPTR(it)
Definition: vector:670
#define _VICONT(it)
Definition: vector:669
void fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2620
iterator begin() _NOEXCEPT
Definition: vector:1023
pointer _Umove(_Iter _First, _Iter _Last, pointer _Ptr)
Definition: vector:1644
size_type size() const _NOEXCEPT
Definition: vector:1146
_Mybase::value_type value_type
Definition: vector:661
size_type max_size() const _NOEXCEPT
Definition: vector:1151
void _Orphan_range(pointer, pointer) const
Definition: vector:1779
#define _CATCH_ALL
Definition: xstddef:62
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
_Mybase::size_type size_type
Definition: vector:662
size_type _Unused_capacity() const _NOEXCEPT
Definition: vector:1013
void _Destroy(pointer _First, pointer _Last)
Definition: vector:1564
size_type _Grow_to(size_type _Count) const
Definition: vector:1570
_Diff _Count
Definition: algorithm:1941
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
pointer _Ufill(pointer _Ptr, size_type _Count, const value_type *_Pval)
Definition: vector:1745
_Mybase::pointer pointer
Definition: vector:664
#define _RERAISE
Definition: xstddef:74
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
bool vector< _Ty, _Alloc >::_Inside ( const value_type _Ptr) const
inlineprotected
1582  { // test if _Ptr points inside vector
1583  return (_Ptr < this->_Mylast && this->_Myfirst <= _Ptr);
1584  }
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::_Make_iter ( const_iterator  _Where) const
inline
1044  { // make iterator from const_iterator
1045  return (iterator(_Where._Ptr, this));
1046  }
_Mybase::iterator iterator
Definition: vector:672
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Orphan_range ( pointer  ,
pointer   
) const
inlineprotected
1780  { // orphan iterators within specified (inclusive) range
1781  }
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Pop_back_n ( size_type  _Count)
inline
1495  { // erase _Count elements at end
1496  pointer _Ptr = this->_Mylast - _Count;
1497 
1498  #if _ITERATOR_DEBUG_LEVEL == 2
1499  _Orphan_range(_Ptr, this->_Mylast);
1500  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1501 
1502  _Destroy(_Ptr, this->_Mylast);
1503  this->_Mylast = _Ptr;
1504  }
void _Orphan_range(pointer, pointer) const
Definition: vector:1779
void _Destroy(pointer _First, pointer _Last)
Definition: vector:1564
_Diff _Count
Definition: algorithm:1941
_Mybase::pointer pointer
Definition: vector:664
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Reallocate ( size_type  _Count)
inlineprotected
1587  { // move to array of exactly _Count elements
1588  pointer _Ptr = this->_Getal().allocate(_Count);
1589 
1590  _TRY_BEGIN
1591  _Umove(this->_Myfirst, this->_Mylast, _Ptr);
1592  _CATCH_ALL
1593  this->_Getal().deallocate(_Ptr, _Count);
1594  _RERAISE;
1595  _CATCH_END
1596 
1597  size_type _Size = size();
1598  if (this->_Myfirst != pointer())
1599  { // destroy and deallocate old array
1600  _Destroy(this->_Myfirst, this->_Mylast);
1601  this->_Getal().deallocate(this->_Myfirst,
1602  this->_Myend - this->_Myfirst);
1603  }
1604 
1605  this->_Orphan_all();
1606  this->_Myend = _Ptr + _Count;
1607  this->_Mylast = _Ptr + _Size;
1608  this->_Myfirst = _Ptr;
1609  }
void _Orphan_all()
Definition: xutility:42
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
pointer _Umove(_Iter _First, _Iter _Last, pointer _Ptr)
Definition: vector:1644
size_type size() const _NOEXCEPT
Definition: vector:1146
#define _CATCH_ALL
Definition: xstddef:62
_Mybase::size_type size_type
Definition: vector:662
void _Destroy(pointer _First, pointer _Last)
Definition: vector:1564
_Diff _Count
Definition: algorithm:1941
_Mybase::pointer pointer
Definition: vector:664
#define _RERAISE
Definition: xstddef:74
_Check_return_ _In_ long _Size
Definition: io.h:325
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Reserve ( size_type  _Count)
inlineprotected
1612  { // ensure room for _Count new elements, grow exponentially
1613  if (_Unused_capacity() < _Count)
1614  { // need more room, try to get it
1615  if (max_size() - size() < _Count)
1616  _Xlen();
1618  }
1619  }
void _Reallocate(size_type _Count)
Definition: vector:1586
size_type size() const _NOEXCEPT
Definition: vector:1146
size_type max_size() const _NOEXCEPT
Definition: vector:1151
size_type _Unused_capacity() const _NOEXCEPT
Definition: vector:1013
size_type _Grow_to(size_type _Count) const
Definition: vector:1570
_Diff _Count
Definition: algorithm:1941
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::_Tidy ( )
inlineprotected
1622  { // free all storage
1623  if (this->_Myfirst != pointer())
1624  { // something to free, destroy and deallocate it
1625  this->_Orphan_all();
1626  _Destroy(this->_Myfirst, this->_Mylast);
1627  this->_Getal().deallocate(this->_Myfirst,
1628  this->_Myend - this->_Myfirst);
1629  this->_Myfirst = pointer();
1630  this->_Mylast = pointer();
1631  this->_Myend = pointer();
1632  }
1633  }
void _Orphan_all()
Definition: xutility:42
void _Destroy(pointer _First, pointer _Last)
Definition: vector:1564
_Mybase::pointer pointer
Definition: vector:664
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
pointer vector< _Ty, _Alloc >::_Ucopy ( _Iter  _First,
_Iter  _Last,
pointer  _Ptr 
)
inlineprotected
1637  { // copy initializing [_First, _Last), using allocator
1638  _Alty _Alval(this->_Getal());
1639  return (_Uninitialized_copy(_First, _Last,
1640  _Ptr, _Alval));
1641  }
_FwdIt _Uninitialized_copy(_InIt _First, _InIt _Last, _FwdIt _Dest, _Alloc &_Al)
Definition: xmemory:422
_Vec_base_types< _Ty, _Alloc >::_Alty _Alval
Definition: vector:499
_Mybase::_Alty _Alty
Definition: vector:659
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
pointer vector< _Ty, _Alloc >::_Ufill ( pointer  _Ptr,
size_type  _Count,
const value_type _Pval 
)
inlineprotected
1746  { // copy initializing _Count * _Val, using allocator
1747  _Alty _Alval(this->_Getal());
1748  _Uninitialized_fill_n(_Ptr, _Count, _Pval, _Alval);
1749  return (_Ptr + _Count);
1750  }
void _Uninitialized_fill_n(_FwdIt _First, _Diff _Count, const _Tval *_Pval, _Alloc &_Al)
Definition: xmemory:631
_Vec_base_types< _Ty, _Alloc >::_Alty _Alval
Definition: vector:499
_Mybase::_Alty _Alty
Definition: vector:659
_Diff _Count
Definition: algorithm:1941
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
pointer vector< _Ty, _Alloc >::_Umove ( _Iter  _First,
_Iter  _Last,
pointer  _Ptr 
)
inlineprotected
1645  { // move initializing [_First, _Last), using allocator
1646  _Alty _Alval(this->_Getal());
1647  return (_Uninitialized_move(_First, _Last,
1648  _Ptr, _Alval));
1649  }
_Vec_base_types< _Ty, _Alloc >::_Alty _Alval
Definition: vector:499
_Mybase::_Alty _Alty
Definition: vector:659
_FwdIt _Uninitialized_move(_InIt _First, _InIt _Last, _FwdIt _Dest, _Alloc &_Al)
Definition: xmemory:490
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type vector< _Ty, _Alloc >::_Unused_capacity ( ) const
inline
1014  { // micro-optimization for capacity() - size()
1015  return (this->_Myend - this->_Mylast);
1016  }
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::assign ( _XSTD initializer_list< value_type _Ilist)
inline
933  { // assign initializer_list
934  assign(_Ilist.begin(), _Ilist.end());
935  }
void assign(_XSTD initializer_list< value_type > _Ilist)
Definition: vector:932
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, void>::type vector< _Ty, _Alloc >::assign ( _Iter  _First,
_Iter  _Last 
)
inline
1290  { // assign [_First, _Last)
1291  clear();
1292  _Assign(_First, _Last, _Iter_cat(_First));
1293  }
iterator_traits< _Iter >::iterator_category _Iter_cat(const _Iter &)
Definition: xutility:404
void clear() _NOEXCEPT
Definition: vector:1506
void _Assign(_Iter _First, _Iter _Last, input_iterator_tag)
Definition: vector:1296
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::assign ( size_type  _Count,
const value_type _Val 
)
inline
1321  { // assign _Count * _Val
1322  clear();
1323  insert(begin(), _Count, _Val);
1324  }
iterator begin() _NOEXCEPT
Definition: vector:1023
iterator insert(const_iterator _Where, _Ty &&_Val)
Definition: vector:887
void clear() _NOEXCEPT
Definition: vector:1506
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reference vector< _Ty, _Alloc >::at ( size_type  _Pos) const
inline
1167  { // subscript nonmutable sequence with checking
1168  if (size() <= _Pos)
1169  _Xran();
1170  return (*(this->_Myfirst + _Pos));
1171  }
size_type size() const _NOEXCEPT
Definition: vector:1146
template<class _Ty, class _Alloc = allocator<_Ty>>
reference vector< _Ty, _Alloc >::at ( size_type  _Pos)
inline
1174  { // subscript mutable sequence with checking
1175  if (size() <= _Pos)
1176  _Xran();
1177  return (*(this->_Myfirst + _Pos));
1178  }
size_type size() const _NOEXCEPT
Definition: vector:1146
template<class _Ty, class _Alloc = allocator<_Ty>>
reference vector< _Ty, _Alloc >::back ( )
inline
1233  { // return last element of mutable sequence
1234  return (*(end() - 1));
1235  }
iterator end() _NOEXCEPT
Definition: vector:1033
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reference vector< _Ty, _Alloc >::back ( ) const
inline
1238  { // return last element of nonmutable sequence
1239  return (*(end() - 1));
1240  }
iterator end() _NOEXCEPT
Definition: vector:1033
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::begin ( )
inline
1024  { // return iterator for beginning of mutable sequence
1025  return (iterator(this->_Myfirst, this));
1026  }
_Mybase::iterator iterator
Definition: vector:672
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator vector< _Ty, _Alloc >::begin ( ) const
inline
1029  { // return iterator for beginning of nonmutable sequence
1030  return (const_iterator(this->_Myfirst, this));
1031  }
_Mybase::const_iterator const_iterator
Definition: vector:673
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type vector< _Ty, _Alloc >::capacity ( ) const
inline
1009  { // return current length of allocated storage
1010  return (this->_Myend - this->_Myfirst);
1011  }
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator vector< _Ty, _Alloc >::cbegin ( ) const
inline
1069  { // return iterator for beginning of nonmutable sequence
1070  return (((const _Myt *)this)->begin());
1071  }
vector< _Ty, _Alloc > _Myt
Definition: vector:654
iterator begin() _NOEXCEPT
Definition: vector:1023
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator vector< _Ty, _Alloc >::cend ( ) const
inline
1074  { // return iterator for end of nonmutable sequence
1075  return (((const _Myt *)this)->end());
1076  }
vector< _Ty, _Alloc > _Myt
Definition: vector:654
iterator end() _NOEXCEPT
Definition: vector:1033
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::clear ( )
inline
1507  { // erase all
1508  this->_Orphan_all();
1509  _Destroy(this->_Myfirst, this->_Mylast);
1510  this->_Mylast = this->_Myfirst;
1511  }
void _Orphan_all()
Definition: xutility:42
void _Destroy(pointer _First, pointer _Last)
Definition: vector:1564
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reverse_iterator vector< _Ty, _Alloc >::crbegin ( ) const
inline
1079  { // return iterator for beginning of reversed nonmutable sequence
1080  return (((const _Myt *)this)->rbegin());
1081  }
vector< _Ty, _Alloc > _Myt
Definition: vector:654
reverse_iterator rbegin() _NOEXCEPT
Definition: vector:1048
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reverse_iterator vector< _Ty, _Alloc >::crend ( ) const
inline
1084  { // return iterator for end of reversed nonmutable sequence
1085  return (((const _Myt *)this)->rend());
1086  }
vector< _Ty, _Alloc > _Myt
Definition: vector:654
reverse_iterator rend() _NOEXCEPT
Definition: vector:1058
template<class _Ty, class _Alloc = allocator<_Ty>>
pointer vector< _Ty, _Alloc >::data ( )
inline
1213  { // return address of first element
1214  return (this->_Myfirst);
1215  }
template<class _Ty, class _Alloc = allocator<_Ty>>
const_pointer vector< _Ty, _Alloc >::data ( ) const
inline
1218  { // return address of first element
1219  return (this->_Myfirst);
1220  }
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
iterator vector< _Ty, _Alloc >::emplace ( const_iterator  _Where,
_Valty &&...  _Val 
)
inline
905  { // insert by moving _Val at _Where
906  size_type _Off = _VIPTR(_Where) - this->_Myfirst;
907 
908  #if _ITERATOR_DEBUG_LEVEL == 2
909  if (size() < _Off)
910  _DEBUG_ERROR("vector emplace iterator outside range");
911  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
912 
913  emplace_back(_STD forward<_Valty>(_Val)...);
914  _STD rotate(begin() + _Off, end() - 1, end());
915  return (begin() + _Off);
916  }
#define _VIPTR(it)
Definition: vector:670
iterator begin() _NOEXCEPT
Definition: vector:1023
size_type size() const _NOEXCEPT
Definition: vector:1146
void emplace_back(_Valty &&..._Val)
Definition: vector:893
_FwdIt rotate(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last)
Definition: xutility:3239
iterator end() _NOEXCEPT
Definition: vector:1033
_Mybase::size_type size_type
Definition: vector:662
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class... _Valty>
void vector< _Ty, _Alloc >::emplace_back ( _Valty &&...  _Val)
inline
894  { // insert by moving into element at end
895  if (this->_Mylast == this->_Myend)
896  _Reserve(1);
897  _Orphan_range(this->_Mylast, this->_Mylast);
898  this->_Getal().construct(this->_Mylast,
899  _STD forward<_Valty>(_Val)...);
900  ++this->_Mylast;
901  }
void _Orphan_range(pointer, pointer) const
Definition: vector:1779
void _Reserve(size_type _Count)
Definition: vector:1611
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
bool vector< _Ty, _Alloc >::empty ( ) const
inline
1157  { // test if sequence is empty
1158  return (this->_Myfirst == this->_Mylast);
1159  }
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::end ( )
inline
1034  { // return iterator for end of mutable sequence
1035  return (iterator(this->_Mylast, this));
1036  }
_Mybase::iterator iterator
Definition: vector:672
template<class _Ty, class _Alloc = allocator<_Ty>>
const_iterator vector< _Ty, _Alloc >::end ( ) const
inline
1039  { // return iterator for end of nonmutable sequence
1040  return (const_iterator(this->_Mylast, this));
1041  }
_Mybase::const_iterator const_iterator
Definition: vector:673
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::erase ( const_iterator  _Where)
inline
1452  { // erase element at where
1453  _Move(_VIPTR(_Where) + 1, this->_Mylast,
1454  _VIPTR(_Where));
1455  _Destroy(this->_Mylast - 1, this->_Mylast);
1456  --this->_Mylast;
1457  return (_Make_iter(_Where));
1458  }
_OutIt _Move(_InIt _First, _InIt _Last, _OutIt _Dest, _Nonscalar_ptr_iterator_tag)
Definition: xutility:2416
#define _VIPTR(it)
Definition: vector:670
iterator _Make_iter(const_iterator _Where) const
Definition: vector:1043
void _Destroy(pointer _First, pointer _Last)
Definition: vector:1564
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::erase ( const_iterator  _First_arg,
const_iterator  _Last_arg 
)
inline
1463  { // erase [_First, _Last)
1464  if (_First_arg == begin() && _Last_arg == end())
1465  clear();
1466  else if (_First_arg != _Last_arg)
1467  { // clear partial
1468  iterator _First = _Make_iter(_First_arg);
1469  iterator _Last = _Make_iter(_Last_arg);
1470 
1471  if (_First != _Last)
1472  { // worth doing, copy down over hole
1473  #if _ITERATOR_DEBUG_LEVEL == 2
1474  if (_Last < _First || _VICONT(_First) != this
1475  || _VIPTR(_First) < this->_Myfirst
1476  || this->_Mylast < _VIPTR(_Last))
1477  _DEBUG_ERROR("vector erase iterator outside range");
1478  pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
1479  _VIPTR(_First));
1480  _Orphan_range(_VIPTR(_First), this->_Mylast);
1481 
1482  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1483  pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
1484  _VIPTR(_First));
1485  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1486 
1487  _Destroy(_Ptr, this->_Mylast);
1488  this->_Mylast = _Ptr;
1489  }
1490  }
1491  return (_Make_iter(_First_arg));
1492  }
_OutIt _Move(_InIt _First, _InIt _Last, _OutIt _Dest, _Nonscalar_ptr_iterator_tag)
Definition: xutility:2416
Definition: xutility:337
#define _VIPTR(it)
Definition: vector:670
#define _VICONT(it)
Definition: vector:669
iterator begin() _NOEXCEPT
Definition: vector:1023
iterator end() _NOEXCEPT
Definition: vector:1033
void _Orphan_range(pointer, pointer) const
Definition: vector:1779
void clear() _NOEXCEPT
Definition: vector:1506
iterator _Make_iter(const_iterator _Where) const
Definition: vector:1043
void _Destroy(pointer _First, pointer _Last)
Definition: vector:1564
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
_Mybase::pointer pointer
Definition: vector:664
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
reference vector< _Ty, _Alloc >::front ( )
inline
1223  { // return first element of mutable sequence
1224  return (*begin());
1225  }
iterator begin() _NOEXCEPT
Definition: vector:1023
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reference vector< _Ty, _Alloc >::front ( ) const
inline
1228  { // return first element of nonmutable sequence
1229  return (*begin());
1230  }
iterator begin() _NOEXCEPT
Definition: vector:1023
template<class _Ty, class _Alloc = allocator<_Ty>>
_Alloc vector< _Ty, _Alloc >::get_allocator ( ) const
inline
1162  { // return allocator object for values
1163  return (this->_Getal());
1164  }
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::insert ( const_iterator  _Where,
_Ty &&  _Val 
)
inline
888  { // insert by moving _Val at _Where
889  return (emplace(_Where, _STD move(_Val)));
890  }
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
iterator emplace(const_iterator _Where, _Valty &&..._Val)
Definition: vector:904
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::insert ( const_iterator  _Where,
_XSTD initializer_list< value_type _Ilist 
)
inline
939  { // insert initializer_list
940  return (insert(_Where, _Ilist.begin(), _Ilist.end()));
941  }
iterator insert(const_iterator _Where, _Ty &&_Val)
Definition: vector:887
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::insert ( const_iterator  _Where,
const _Ty &  _Val 
)
inline
1327  { // insert _Val at _Where
1328  return (_Insert_n(_Where, (size_type)1, _Val));
1329  }
_Mybase::size_type size_type
Definition: vector:662
_FwdIt const _Ty _Val
Definition: algorithm:1938
iterator _Insert_n(const_iterator _Where, size_type _Count, const value_type &_Val)
Definition: vector:1651
template<class _Ty, class _Alloc = allocator<_Ty>>
iterator vector< _Ty, _Alloc >::insert ( const_iterator  _Where,
size_type  _Count,
const _Ty &  _Val 
)
inline
1333  { // insert _Count * _Val at _Where
1334  return (_Insert_n(_Where, _Count, _Val));
1335  }
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
iterator _Insert_n(const_iterator _Where, size_type _Count, const value_type &_Val)
Definition: vector:1651
template<class _Ty, class _Alloc = allocator<_Ty>>
template<class _Iter >
enable_if<_Is_iterator<_Iter>::value, iterator>::type vector< _Ty, _Alloc >::insert ( const_iterator  _Where,
_Iter  _First,
_Iter  _Last 
)
inline
1341  { // insert [_First, _Last) at _Where
1342  size_type _Off = _VIPTR(_Where) - this->_Myfirst;
1343  _Insert(_Where, _First, _Last, _Iter_cat(_First));
1344  return (begin() + _Off);
1345  }
#define _VIPTR(it)
Definition: vector:670
iterator begin() _NOEXCEPT
Definition: vector:1023
iterator_traits< _Iter >::iterator_category _Iter_cat(const _Iter &)
Definition: xutility:404
void _Insert(const_iterator _Where, _Iter _First, _Iter _Last, input_iterator_tag)
Definition: vector:1348
_Mybase::size_type size_type
Definition: vector:662
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type vector< _Ty, _Alloc >::max_size ( ) const
inline
1152  { // return maximum possible length of sequence
1153  return (this->_Getal().max_size());
1154  }
size_type max_size() const _NOEXCEPT
Definition: vector:1151
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& vector< _Ty, _Alloc >::operator= ( _Myt &&  _Right)
inline
823  { // assign by moving _Right
824  if (this != &_Right)
825  { // different, assign it
826  _Tidy();
827  if (_Alty::propagate_on_container_move_assignment::value
828  && this->_Getal() != _Right._Getal())
829  this->_Change_alloc(_Right._Getal());
830 
831  _Assign_rv(_STD forward<_Myt>(_Right));
832  }
833  return (*this);
834  }
void _Assign_rv(_Myt &&_Right, true_type)
Definition: vector:836
void _Tidy()
Definition: vector:1621
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& vector< _Ty, _Alloc >::operator= ( _XSTD initializer_list< value_type _Ilist)
inline
927  { // assign initializer_list
928  assign(_Ilist.begin(), _Ilist.end());
929  return (*this);
930  }
void assign(_XSTD initializer_list< value_type > _Ilist)
Definition: vector:932
template<class _Ty, class _Alloc = allocator<_Ty>>
_Myt& vector< _Ty, _Alloc >::operator= ( const _Myt _Right)
inline
949  { // assign _Right
950  if (this != &_Right)
951  { // different, assign it
952  if (this->_Getal() != _Right._Getal()
953  && _Alty::propagate_on_container_copy_assignment::value)
954  { // change allocator before copying
955  _Tidy();
956  this->_Change_alloc(_Right._Getal());
957  }
958 
959  this->_Orphan_all();
960 
961  if (_Right.empty())
962  clear(); // new sequence empty, erase existing sequence
963  else if (_Right.size() <= size())
964  { // enough elements, copy new and destroy old
965  pointer _Ptr = _Copy_impl(_Right._Myfirst,
966  _Right._Mylast, this->_Myfirst); // copy new
967  _Destroy(_Ptr, this->_Mylast); // destroy old
968  this->_Mylast = this->_Myfirst + _Right.size();
969  }
970  else if (_Right.size() <= capacity())
971  { // enough room, copy and construct new
972  pointer _Ptr = _Right._Myfirst + size();
973  _Copy_impl(_Right._Myfirst,
974  _Ptr, this->_Myfirst);
975  this->_Mylast = _Ucopy(_Ptr, _Right._Mylast, this->_Mylast);
976  }
977  else
978  { // not enough room, allocate new array and construct new
979  if (this->_Myfirst != pointer())
980  { // discard old array
981  _Destroy(this->_Myfirst, this->_Mylast);
982  this->_Getal().deallocate(this->_Myfirst,
983  this->_Myend - this->_Myfirst);
984  }
985  if (_Buy(_Right.size()))
986  _TRY_BEGIN
987  this->_Mylast = _Ucopy(_Right._Myfirst, _Right._Mylast,
988  this->_Myfirst);
989  _CATCH_ALL
990  _Tidy();
991  _RERAISE;
992  _CATCH_END
993  }
994  }
995  return (*this);
996  }
void _Orphan_all()
Definition: xutility:42
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
size_type capacity() const _NOEXCEPT
Definition: vector:1008
bool _Buy(size_type _Capacity)
Definition: vector:1545
size_type size() const _NOEXCEPT
Definition: vector:1146
void clear() _NOEXCEPT
Definition: vector:1506
#define _CATCH_ALL
Definition: xstddef:62
void _Destroy(pointer _First, pointer _Last)
Definition: vector:1564
_AMPIMP _Event __cdecl _Copy_impl(_In_ _Buffer *_Src, size_t _Src_offset, _Out_ _Buffer *_Dst, size_t _Dest_offset, size_t _Num_elems, size_t _Preferred_copy_chunk_num_elems=0)
_Mybase::pointer pointer
Definition: vector:664
#define _RERAISE
Definition: xstddef:74
void _Tidy()
Definition: vector:1621
pointer _Ucopy(_Iter _First, _Iter _Last, pointer _Ptr)
Definition: vector:1636
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reference vector< _Ty, _Alloc >::operator[] ( size_type  _Pos) const
inline
1181  { // subscript nonmutable sequence
1182  #if _ITERATOR_DEBUG_LEVEL == 2
1183  if (size() <= _Pos)
1184  { // report error
1185  _DEBUG_ERROR("vector subscript out of range");
1187  }
1188 
1189  #elif _ITERATOR_DEBUG_LEVEL == 1
1190  _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
1191  #endif /* _ITERATOR_DEBUG_LEVEL */
1192 
1193  return (*(this->_Myfirst + _Pos));
1194  }
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:351
size_type size() const _NOEXCEPT
Definition: vector:1146
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Ty, class _Alloc = allocator<_Ty>>
reference vector< _Ty, _Alloc >::operator[] ( size_type  _Pos)
inline
1197  { // subscript mutable sequence
1198  #if _ITERATOR_DEBUG_LEVEL == 2
1199  if (size() <= _Pos)
1200  { // report error
1201  _DEBUG_ERROR("vector subscript out of range");
1203  }
1204 
1205  #elif _ITERATOR_DEBUG_LEVEL == 1
1206  _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
1207  #endif /* _ITERATOR_DEBUG_LEVEL */
1208 
1209  return (*(this->_Myfirst + _Pos));
1210  }
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:351
size_type size() const _NOEXCEPT
Definition: vector:1146
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::pop_back ( )
inline
1280  { // erase element at end
1281  this->_Getal().destroy(this->_Mylast - 1);
1282  --this->_Mylast;
1283  }
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::push_back ( value_type &&  _Val)
inline
865  { // insert by moving into element at end
866  if (_Inside(_STD addressof(_Val)))
867  { // push back an element
868  size_type _Idx = _STD addressof(_Val) - this->_Myfirst;
869  if (this->_Mylast == this->_Myend)
870  _Reserve(1);
871  _Orphan_range(this->_Mylast, this->_Mylast);
872  this->_Getal().construct(this->_Mylast,
873  _STD forward<value_type>(this->_Myfirst[_Idx]));
874  ++this->_Mylast;
875  }
876  else
877  { // push back a non-element
878  if (this->_Mylast == this->_Myend)
879  _Reserve(1);
880  _Orphan_range(this->_Mylast, this->_Mylast);
881  this->_Getal().construct(this->_Mylast,
882  _STD forward<value_type>(_Val));
883  ++this->_Mylast;
884  }
885  }
void _Orphan_range(pointer, pointer) const
Definition: vector:1779
void _Reserve(size_type _Count)
Definition: vector:1611
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
_Mybase::size_type size_type
Definition: vector:662
bool _Inside(const value_type *_Ptr) const
Definition: vector:1581
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::push_back ( const value_type _Val)
inline
1243  { // insert element at end
1244  if (_Inside(_STD addressof(_Val)))
1245  { // push back an element
1246  size_type _Idx = _STD addressof(_Val) - this->_Myfirst;
1247  if (this->_Mylast == this->_Myend)
1248  _Reserve(1);
1249  _Orphan_range(this->_Mylast, this->_Mylast);
1250  this->_Getal().construct(this->_Mylast,
1251  this->_Myfirst[_Idx]);
1252  ++this->_Mylast;
1253  }
1254  else
1255  { // push back a non-element
1256  if (this->_Mylast == this->_Myend)
1257  _Reserve(1);
1258  _Orphan_range(this->_Mylast, this->_Mylast);
1259  this->_Getal().construct(this->_Mylast,
1260  _Val);
1261  ++this->_Mylast;
1262  }
1263  }
void _Orphan_range(pointer, pointer) const
Definition: vector:1779
void _Reserve(size_type _Count)
Definition: vector:1611
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
_Mybase::size_type size_type
Definition: vector:662
bool _Inside(const value_type *_Ptr) const
Definition: vector:1581
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty, class _Alloc = allocator<_Ty>>
reverse_iterator vector< _Ty, _Alloc >::rbegin ( )
inline
1049  { // return iterator for beginning of reversed mutable sequence
1050  return (reverse_iterator(end()));
1051  }
iterator end() _NOEXCEPT
Definition: vector:1033
_STD reverse_iterator< iterator > reverse_iterator
Definition: vector:675
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reverse_iterator vector< _Ty, _Alloc >::rbegin ( ) const
inline
1054  { // return iterator for beginning of reversed nonmutable sequence
1055  return (const_reverse_iterator(end()));
1056  }
iterator end() _NOEXCEPT
Definition: vector:1033
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: vector:676
template<class _Ty, class _Alloc = allocator<_Ty>>
reverse_iterator vector< _Ty, _Alloc >::rend ( )
inline
1059  { // return iterator for end of reversed mutable sequence
1060  return (reverse_iterator(begin()));
1061  }
iterator begin() _NOEXCEPT
Definition: vector:1023
_STD reverse_iterator< iterator > reverse_iterator
Definition: vector:675
template<class _Ty, class _Alloc = allocator<_Ty>>
const_reverse_iterator vector< _Ty, _Alloc >::rend ( ) const
inline
1064  { // return iterator for end of reversed nonmutable sequence
1065  return (const_reverse_iterator(begin()));
1066  }
iterator begin() _NOEXCEPT
Definition: vector:1023
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: vector:676
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::reserve ( size_type  _Count)
inline
999  { // determine new minimum length of allocated storage
1000  if (capacity() < _Count)
1001  { // something to do, check and reallocate
1002  if (max_size() < _Count)
1003  _Xlen();
1005  }
1006  }
void _Reallocate(size_type _Count)
Definition: vector:1586
size_type capacity() const _NOEXCEPT
Definition: vector:1008
size_type max_size() const _NOEXCEPT
Definition: vector:1151
_Diff _Count
Definition: algorithm:1941
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::resize ( size_type  _Newsize)
inline
1100  { // determine new length, padding as needed
1101  if (_Newsize < size())
1102  _Pop_back_n(size() - _Newsize);
1103  else if (size() < _Newsize)
1104  { // pad as needed
1105  _Alty _Alval(this->_Getal());
1106  _Reserve(_Newsize - size());
1107  _TRY_BEGIN
1108  _Uninitialized_default_fill_n(this->_Mylast, _Newsize - size(),
1109  _Alval);
1110  _CATCH_ALL
1111  _Tidy();
1112  _RERAISE;
1113  _CATCH_END
1114  this->_Mylast += _Newsize - size();
1115  }
1116  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
void _Uninitialized_default_fill_n(_FwdIt _First, _Diff _Count, _Alloc &_Al)
Definition: xmemory:688
size_type size() const _NOEXCEPT
Definition: vector:1146
#define _CATCH_ALL
Definition: xstddef:62
void _Reserve(size_type _Count)
Definition: vector:1611
_Vec_base_types< _Ty, _Alloc >::_Alty _Alval
Definition: vector:499
_Mybase::_Alty _Alty
Definition: vector:659
void _Pop_back_n(size_type _Count)
Definition: vector:1494
#define _RERAISE
Definition: xstddef:74
void _Tidy()
Definition: vector:1621
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::resize ( size_type  _Newsize,
const value_type _Val 
)
inline
1119  { // determine new length, padding with _Val elements as needed
1120  if (_Newsize < size())
1121  _Pop_back_n(size() - _Newsize);
1122  else if (size() < _Newsize)
1123  { // pad as needed
1124  const value_type *_Ptr = _STD addressof(_Val);
1125 
1126  if (_Inside(_Ptr))
1127  { // padding is inside vector, recompute _Ptr after reserve
1128  const difference_type _Idx = _Ptr
1129  - _STD addressof(*this->_Myfirst);
1130  _Reserve(_Newsize - size());
1131  _Ptr = _STD addressof(*this->_Myfirst) + _Idx;
1132  }
1133  else
1134  _Reserve(_Newsize - size());
1135 
1136  _TRY_BEGIN
1137  _Ufill(this->_Mylast, _Newsize - size(), _Ptr);
1138  _CATCH_ALL
1139  _Tidy();
1140  _RERAISE;
1141  _CATCH_END
1142  this->_Mylast += _Newsize - size();
1143  }
1144  }
#define _TRY_BEGIN
Definition: xstddef:60
#define _CATCH_END
Definition: xstddef:63
_Mybase::difference_type difference_type
Definition: vector:663
size_type size() const _NOEXCEPT
Definition: vector:1146
_Mybase::value_type value_type
Definition: vector:661
#define _CATCH_ALL
Definition: xstddef:62
void _Reserve(size_type _Count)
Definition: vector:1611
_Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:91
bool _Inside(const value_type *_Ptr) const
Definition: vector:1581
void _Pop_back_n(size_type _Count)
Definition: vector:1494
pointer _Ufill(pointer _Ptr, size_type _Count, const value_type *_Pval)
Definition: vector:1745
#define _RERAISE
Definition: xstddef:74
_FwdIt const _Ty _Val
Definition: algorithm:1938
void _Tidy()
Definition: vector:1621
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::shrink_to_fit ( )
inline
1089  { // reduce capacity
1090  if (_Has_unused_capacity())
1091  { // worth shrinking, do it
1092  if (empty())
1093  _Tidy();
1094  else
1095  _Reallocate(size());
1096  }
1097  }
void _Reallocate(size_type _Count)
Definition: vector:1586
size_type size() const _NOEXCEPT
Definition: vector:1146
size_type _Has_unused_capacity() const _NOEXCEPT
Definition: vector:1018
void _Tidy()
Definition: vector:1621
bool empty() const _NOEXCEPT
Definition: vector:1156
template<class _Ty, class _Alloc = allocator<_Ty>>
size_type vector< _Ty, _Alloc >::size ( ) const
inline
1147  { // return length of sequence
1148  return (this->_Mylast - this->_Myfirst);
1149  }
template<class _Ty, class _Alloc = allocator<_Ty>>
void vector< _Ty, _Alloc >::swap ( _Myt _Right)
inline
1514  { // exchange contents with _Right
1515  if (this == &_Right)
1516  ; // same object, do nothing
1517  else if (this->_Getal() == _Right._Getal())
1518  { // same allocator, swap control information
1519  this->_Swap_all(_Right);
1520  _Swap_adl(this->_Myfirst, _Right._Myfirst);
1521  _Swap_adl(this->_Mylast, _Right._Mylast);
1522  _Swap_adl(this->_Myend, _Right._Myend);
1523  }
1524 
1525  else if (_Alty::propagate_on_container_swap::value)
1526  { // swap allocators and control information
1527  this->_Swap_alloc(_Right);
1528  _Swap_adl(this->_Myfirst, _Right._Myfirst);
1529  _Swap_adl(this->_Mylast, _Right._Mylast);
1530  _Swap_adl(this->_Myend, _Right._Myend);
1531  }
1532 
1533  else
1534  { // containers are incompatible
1535  #if _ITERATOR_DEBUG_LEVEL == 2
1536  _DEBUG_ERROR("vector containers incompatible for swap");
1537 
1538  #else /* ITERATOR_DEBUG_LEVEL == 2 */
1539  _XSTD terminate();
1540  #endif /* ITERATOR_DEBUG_LEVEL == 2 */
1541  }
1542  }
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

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