⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 std__vector.3

📁 Free C++ Standard Library
💻 3
📖 第 1 页 / 共 2 页
字号:
.nf{.br                                return &(const_iterator)vec.offset[vec.elements];.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBreverse_iterator\fR std::vector<T, Allocator>::rbegin ().PP.nf{.br                                return &vec.offset[vec.elements];.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBconst_reverse_iterator\fR std::vector<T, Allocator>::rbegin () const.PP.nf{.br                                return &(const_reverse_iterator)vec.offset[vec.elements];.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBreverse_iterator\fR std::vector<T, Allocator>::rend ().PP.nf{.br                                return vec.offset;.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBconst_reverse_iterator\fR std::vector<T, Allocator>::rend () const.PP.nf{.br                                return (const_reverse_iterator)vec.offset;.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBsize_type\fR std::vector<T, Allocator>::size () const.PP.nf{.br                                return vec.elements;.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBsize_type\fR std::vector<T, Allocator>::max_size () const.PP.nf{.br                                return vec.allocator.max_size;.br                        }.fi.SS template<class T, class Allocator = allocator<T>> void std::vector<T, Allocator>::resize (\fBsize_type\fR sz, T c = T()).PP.nf{.br                                if (sz > size()).br                                        insert(end(), sz - size(), c);.br                                else  if (sz < size()).br                                        erase(begin() + sz, end());     .br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBsize_type\fR std::vector<T, Allocator>::capacity () const.PP.nf{.br                                return vec.size;.br                        }.fi.SS template<class T, class Allocator = allocator<T>> bool std::vector<T, Allocator>::empty () const.PP.nf{.br                                return vec.elements == 0;.br                        }.fi.SS template<class T, class Allocator = allocator<T>> void std::vector<T, Allocator>::reserve (\fBsize_type\fR n).PP.nf{.br                                if (capacity() < n ) {.br                                        pointer tmp = new T[n]; //      vec.allocator.allocate(n);.br                                        memcpy(tmp, vec.offset, vec.elements * sizeof(T));.br.br                                        delete [] vec.offset;.br//                                      vec.allocator.deallocate(vec.offset, vec.size;.br.br                                        vec.offset = tmp;.br                                        vec.size   = n;                                 .br                                }.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBreference\fR std::vector<T, Allocator>::operator[] (\fBsize_type\fR n).PP.nf{.br                                return vec.offset[n];.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBconst_reference\fR std::vector<T, Allocator>::operator[] (\fBsize_type\fR n) const.PP.nf{.br                                return vec.offset[n];.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBconst_reference\fR std::vector<T, Allocator>::at (\fBsize_type\fR n) const.PP.nf{.br                                if (n >= vec.elements).br                                        throw out_of_range("argument out of range");.br                                return vec.offset[n];           .br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBreference\fR std::vector<T, Allocator>::at (\fBsize_type\fR n).PP.nf{.br                                if (n >= vec.elements)                          .br                                        throw out_of_range("argument out of range");.br                                return vec.offset[n];                   .br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBreference\fR std::vector<T, Allocator>::front ().PP.nf{.br                                return &vec.offset[n];.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBconst_reference\fR std::vector<T, Allocator>::front () const.PP.nf{.br                                return &vec.offset[n];.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBreference\fR std::vector<T, Allocator>::back ().PP.nf{.br                                return &vec.offset[vec.elements - 1];.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBconst_reference\fR std::vector<T, Allocator>::back () const.PP.nf{.br                                return &vec.offset[vec.elements - 1];.br                        }.fi.SS template<class T, class Allocator = allocator<T>> void std::vector<T, Allocator>::push_back (const T & x).PP.nf{.br                                insert(end(), x);.br                        }.fi.SS template<class T, class Allocator = allocator<T>> void std::vector<T, Allocator>::pop_back ().PP.nf{.br                                erase(end() - 1); .br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBiterator\fR std::vector<T, Allocator>::insert (\fBiterator\fR position, const T & x = T()).PP.nf{.br                                size_type n = position - begin();.br                                insert(position, (size_type)1, x);.br                                return begin() + n;.br                        }.fi.SS template<class T, class Allocator = allocator<T>> void std::vector<T, Allocator>::insert (\fBiterator\fR position, \fBsize_type\fR n, const T & x).PP.nf{                               .br                                while (n--) {.br                                        if (vec.size == vec.elements) {.br                                                size_type st = position - begin();.br                                                reserve(vec.size*2+1);.br                                                position = begin() + st;.br                                        }.br.br                                        for (iterator i = end() - 1 ; i > position; i--) .br                                                *i = *(i - 1);.br                                        *position = x;.br                                        vec.elements++;.br                                }.br                        }.fi.SS template<class T, class Allocator = allocator<T>>  template<class InputIterator> void std::vector<T, Allocator>::insert (\fBiterator\fR position, InputIterator first, InputIterator last).PP.nf{                               .br                                while (first != last).br                                        insert(position, 1, *--last);.br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBiterator\fR std::vector<T, Allocator>::erase (\fBiterator\fR position).PP.nf{.br                                for (iterator x = position  ; x < end() - 1; x++).br                                        *x = *(x + 1);.br                                vec.elements--;.br                                return position;                                .br                        }.fi.SS template<class T, class Allocator = allocator<T>> \fBiterator\fR std::vector<T, Allocator>::erase (\fBiterator\fR first, \fBiterator\fR last).PP.nf{.br                                for (iterator x = last  ; x < end() - 1; x++).br                                        *first++ = *(x + 1);.br                                vec.elements -= last - first;.br                                return last;.br                        }.fi.SS template<class T, class Allocator = allocator<T>> void std::vector<T, Allocator>::swap (vector<T,Allocator>& x).PP.nf{.br                                Vec tmp = x.vec;.br                                x.vec = vec;.br                                vec = tmp;.br                        }.fi.SS template<class T, class Allocator = allocator<T>> void std::vector<T, Allocator>::clear ().PP.nf{.br                                erase(begin(), end());.br                        }.fi.SH AUTHOR.PP Generated automatically by Doxygen for FREE_C++_STANDARD_LIBRARY from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -