📄 std__vector.3
字号:
.TH std::vector 3 "16 Sep 1999" "FREE_C++_STANDARD_LIBRARY" \" -*- nroff -*-.ad l.nh.SH NAMEstd::vector \- .SH SYNOPSIS.br.PP.SS Public Members.in +1c.ti -1c.RI "typedef Allocator::reference \fBreference\fR".br.ti -1c.RI "typedef Allocator::const_reference \fBconst_reference\fR".br.ti -1c.RI "typedef Allocator::size_type \fBsize_type\fR".br.ti -1c.RI "typedef Allocator::difference_type \fBdifference_type\fR".br.ti -1c.RI "typedef T \fBvalue_type\fR".br.ti -1c.RI "typedef Allocator \fBallocator_type\fR".br.ti -1c.RI "typedef Allocator::pointer \fBpointer\fR".br.ti -1c.RI "typedef Allocator::const_pointer \fBconst_pointer\fR".br.ti -1c.RI "typedef Allocator::pointer \fBiterator\fR".br.ti -1c.RI "typedef Allocator::const_pointer \fBconst_iterator\fR".br.ti -1c.RI "typedef std::reverse_iterator<iterator> \fBreverse_iterator\fR".br.ti -1c.RI "typedef std::reverse_iterator<const_iterator> \fBconst_reverse_iterator\fR".br.ti -1c.RI "explicit \fBvector\fR (const Allocator &alloc = Allocator())".br.ti -1c.RI "template<class InputIterator> \fBvector\fR<InputIterator> (InputIterator first, InputIterator last, const Allocator &alloc = Allocator())".br.ti -1c.RI "explicit \fBvector\fR (\fBsize_type\fR n, const T& value = T(), const Allocator &alloc= Allocator())".br.ti -1c.RI "\fB~vector\fR ()".br.ti -1c.RI "vector<T,Allocator>& \fBoperator=\fR (const vector<T,Allocator> &x)".br.ti -1c.RI "template<class InputIterator> void \fBassign\fR<InputIterator> (InputIterator first, InputIterator last)".br.ti -1c.RI "\fBallocator_type\fR \fBget_allocator\fR () const".br.ti -1c.RI "\fBiterator\fR \fBbegin\fR ()".br.ti -1c.RI "\fBconst_iterator\fR \fBbegin\fR () const".br.ti -1c.RI "\fBiterator\fR \fBend\fR ()".br.ti -1c.RI "\fBconst_iterator\fR \fBend\fR () const".br.ti -1c.RI "\fBreverse_iterator\fR \fBrbegin\fR ()".br.ti -1c.RI "\fBconst_reverse_iterator\fR \fBrbegin\fR () const".br.ti -1c.RI "\fBreverse_iterator\fR \fBrend\fR ()".br.ti -1c.RI "\fBconst_reverse_iterator\fR \fBrend\fR () const".br.ti -1c.RI "\fBsize_type\fR \fBsize\fR () const".br.ti -1c.RI "\fBsize_type\fR \fBmax_size\fR () const".br.ti -1c.RI "void \fBresize\fR (\fBsize_type\fR sz, T c = T())".br.ti -1c.RI "\fBsize_type\fR \fBcapacity\fR () const".br.ti -1c.RI "bool \fBempty\fR () const".br.ti -1c.RI "void \fBreserve\fR (\fBsize_type\fR n)".br.ti -1c.RI "\fBreference\fR \fBoperator[]\fR (\fBsize_type\fR n)".br.ti -1c.RI "\fBconst_reference\fR \fBoperator[]\fR (\fBsize_type\fR n) const".br.ti -1c.RI "\fBconst_reference\fR \fBat\fR (\fBsize_type\fR n) const".br.ti -1c.RI "\fBreference\fR \fBat\fR (\fBsize_type\fR n)".br.ti -1c.RI "\fBreference\fR \fBfront\fR ()".br.ti -1c.RI "\fBconst_reference\fR \fBfront\fR () const".br.ti -1c.RI "\fBreference\fR \fBback\fR ()".br.ti -1c.RI "\fBconst_reference\fR \fBback\fR () const".br.ti -1c.RI "void \fBpush_back\fR (const T &x)".br.ti -1c.RI "void \fBpop_back\fR ()".br.ti -1c.RI "\fBiterator\fR \fBinsert\fR (\fBiterator\fR position, const T &x = T())".br.ti -1c.RI "void \fBinsert\fR (\fBiterator\fR position, \fBsize_type\fR n, const T& x)".br.ti -1c.RI "template<class InputIterator> void \fBinsert\fR<InputIterator> (\fBiterator\fR position, InputIterator first, InputIterator last)".br.ti -1c.RI "\fBiterator\fR \fBerase\fR (\fBiterator\fR position)".br.ti -1c.RI "\fBiterator\fR \fBerase\fR (\fBiterator\fR first, \fBiterator\fR last)".br.ti -1c.RI "void \fBswap\fR (vector<T,Allocator> &x)".br.ti -1c.RI "void \fBclear\fR ()".br.in -1c.SH DETAILED DESCRIPTION.PP .SS template<class T, class Allocator = allocator<T>> class std::vectorA \fBvector\fR satisfies all of the requirements of a container and of a reversible container and of a sequence, including most of the optional sequence requirements (_lib.sequence.reqmts_). The excep- tions are the push_front and pop_front member functions, which are not provided. Descriptions are provided here only for operations on vec- tor that are not described in one of these tables or for operations where there is additional semantic information. .SH MEMBER TYPEDEF DOCUMENTATION.PP .SS template<class T, class Allocator = allocator<T>> typedef Allocator::reference std::vector<T, Allocator>::reference.PP.SS template<class T, class Allocator = allocator<T>> typedef Allocator::const_reference std::vector<T, Allocator>::const_reference.PP.SS template<class T, class Allocator = allocator<T>> typedef Allocator::size_type std::vector<T, Allocator>::size_type.PP.SS template<class T, class Allocator = allocator<T>> typedef Allocator::difference_type std::vector<T, Allocator>::difference_type.PP.SS template<class T, class Allocator = allocator<T>> typedef T std::vector<T, Allocator>::value_type.PP.SS template<class T, class Allocator = allocator<T>> typedef Allocator std::vector<T, Allocator>::allocator_type.PP.SS template<class T, class Allocator = allocator<T>> typedef Allocator::pointer std::vector<T, Allocator>::pointer.PP.SS template<class T, class Allocator = allocator<T>> typedef Allocator::const_pointer std::vector<T, Allocator>::const_pointer.PP.SS template<class T, class Allocator = allocator<T>> typedef Allocator::pointer std::vector<T, Allocator>::iterator.PP.SS template<class T, class Allocator = allocator<T>> typedef Allocator::const_pointer std::vector<T, Allocator>::const_iterator.PP.SS template<class T, class Allocator = allocator<T>> typedef std::reverse_iterator<iterator> std::vector<T, Allocator>::reverse_iterator.PP.SS template<class T, class Allocator = allocator<T>> typedef std::reverse_iterator<const_iterator> std::vector<T, Allocator>::const_reverse_iterator.PP.SH MEMBER FUNCTION DOCUMENTATION.PP .SS template<class T, class Allocator = allocator<T>> explicit std::vector<T, Allocator>::vector<T, Allocator> (const Allocator & alloc = Allocator()).PP.nf{ .br vec.size = 0;.br vec.elements = 0;.br vec.allocator = alloc;.br vec.offset = vec.allocator.allocate(0);.br }.fi.SS template<class T, class Allocator = allocator<T>> template<class InputIterator> std::vector<T, Allocator>::vector<T, Allocator> (InputIterator first, InputIterator last, const Allocator & alloc = Allocator()).PP.nf{.br vec.size = 0;.br vec.elements = 0;.br vec.allocator = alloc;.br vec.offset = vec.allocator.allocate(0);.br insert(begin(), first, last);.br }.fi.SS template<class T, class Allocator = allocator<T>> explicit std::vector<T, Allocator>::vector<T, Allocator> (\fBsize_type\fR n, const T & value = T(), const Allocator & alloc = Allocator()).PP.nf{.br vec.size = 0;.br vec.elements = 0;.br vec.allocator = alloc;.br vec.offset = vec.allocator.allocate(0);.br reserve(n);.br /// TODO : insert value.br }.fi.SS template<class T, class Allocator = allocator<T>> std::vector<T, Allocator>::~vector<T, Allocator> ().PP.nf{.br vec.allocator.deallocate(vec.offset, vec.size);.br }.fi.SS template<class T, class Allocator = allocator<T>> vector<T,Allocator>& std::vector<T, Allocator>::operator=<T,Allocator> (const vector<T,Allocator>& x).PP.nf{.br vec = x.vec;.br }.fi.SS template<class T, class Allocator = allocator<T>> template<class InputIterator> void std::vector<T, Allocator>::assign (InputIterator first, InputIterator last).PP.nf{.br erase(begin(), end());.br insert(begin(), first, last);.br }.fi.SS template<class T, class Allocator = allocator<T>> \fBallocator_type\fR std::vector<T, Allocator>::get_allocator () const.PP.nf{.br return vec.allocator;.br }.fi.SS template<class T, class Allocator = allocator<T>> \fBiterator\fR std::vector<T, Allocator>::begin ().PP.nf{.br return vec.offset;.br }.fi.SS template<class T, class Allocator = allocator<T>> \fBconst_iterator\fR std::vector<T, Allocator>::begin () const.PP.nf{.br return (const_iterator)vec.offset;.br }.fi.SS template<class T, class Allocator = allocator<T>> \fBiterator\fR std::vector<T, Allocator>::end ().PP.nf{.br return &vec.offset[vec.elements];.br }.fi.SS template<class T, class Allocator = allocator<T>> \fBconst_iterator\fR std::vector<T, Allocator>::end () const.PP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -