#include <stl_vector.h>
Inheritance diagram for std::vector< _Tp, _Alloc >:
Public Member Functions | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_type | size () const |
size_type | max_size () const |
size_type | capacity () const |
bool | empty () const |
reference | operator[] (size_type __n) |
Subscript access to the data contained in the vector. | |
const_reference | operator[] (size_type __n) const |
Subscript access to the data contained in the vector. | |
reference | at (size_type __n) |
Provides access to the data contained in the vector. | |
const_reference | at (size_type __n) const |
Provides access to the data contained in the vector. | |
void | reserve (size_type __n) |
Attempt to preallocate enough memory for specified number of elements. | |
void | assign (size_type __n, const _Tp &__val) |
Assigns a given value or range to a vector. | |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
void | push_back (const _Tp &__x) |
Add data to the end of the vector. | |
void | push_back () |
iterator | insert (iterator __position, const _Tp &__x) |
Inserts given value into vector at specified element. | |
iterator | insert (iterator __position) |
Inserts an empty element into the vector. | |
void | insert (iterator __pos, size_type __n, const _Tp &__x) |
Inserts a number of copies of given data into the vector. | |
void | pop_back () |
Removes last element from vector. | |
iterator | erase (iterator __position) |
Remove element at given position. | |
iterator | erase (iterator __first, iterator __last) |
Remove a range of elements from a vector. | |
void | resize (size_type __new_size, const _Tp &__x) |
Resizes the vector to the specified number of elements. | |
void | resize (size_type __new_size) |
Resizes the vector to the specified number of elements. | |
void | clear () |
Meets the requirements of a container, a reversible container, and a sequence, including the optional sequence requirements with the exception of push_front
and pop_front
.
In some terminology a vector can be described as a dynamic C-style array, it offers fast and efficient access to individual elements in any order and saves the user from worrying about memory and size allocation. Subscripting ( [] ) access is also provided as with C-style arrays.
Definition at line 166 of file stl_vector.h.
|
Assigns a given value or range to a vector.
Definition at line 423 of file stl_vector.h. |
|
Provides access to the data contained in the vector.
Definition at line 328 of file stl_vector.h. |
|
Provides access to the data contained in the vector.
Definition at line 316 of file stl_vector.h. |
|
Returns a read-only (constant) reference to the data at the first element of the vector. Definition at line 479 of file stl_vector.h. |
|
Returns a read/write reference to the data at the last element of the vector. Definition at line 473 of file stl_vector.h. |
|
Returns a read-only (constant) iterator that points to the first element in the vector. Iteration is done in ordinary element order. Definition at line 214 of file stl_vector.h. |
|
Returns a read/write iterator that points to the first element in the vector. Iteration is done in ordinary element order. Definition at line 208 of file stl_vector.h. Referenced by std::vector< _Node *, _Alloc >::capacity(), std::vector< _Node *, _Alloc >::clear(), std::vector< _Node *, _Alloc >::empty(), std::vector< _Node *, _Alloc >::front(), std::vector< _Node *, _Alloc >::insert(), std::vector< _Node *, _Alloc >::operator[](), std::vector< _Node *, _Alloc >::rend(), std::vector< _Node *, _Alloc >::resize(), and std::vector< _Node *, _Alloc >::size(). |
|
Returns the amount of memory that has been alocated for the current elements (?). Definition at line 271 of file stl_vector.h. Referenced by std::vector< _Node *, _Alloc >::reserve(). |
|
Erases all elements in vector. Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibilty. Definition at line 711 of file stl_vector.h. |
|
Returns true if the vector is empty. (Thus begin() would equal end().) Definition at line 277 of file stl_vector.h. |
|
Returns a read-only (constant) iterator that points one past the last element in the vector. Iteration is done in ordinary element order. Definition at line 227 of file stl_vector.h. |
|
Returns a read/write iterator that points one past the last element in the vector. Iteration is done in ordinary element order. Definition at line 221 of file stl_vector.h. Referenced by std::vector< _Node *, _Alloc >::back(), std::vector< _Node *, _Alloc >::clear(), std::vector< _Node *, _Alloc >::empty(), std::vector< _Node *, _Alloc >::erase(), std::vector< _Node *, _Alloc >::insert(), std::vector< _Node *, _Alloc >::push_back(), std::vector< _Node *, _Alloc >::rbegin(), std::vector< _Node *, _Alloc >::resize(), and std::vector< _Node *, _Alloc >::size(). |
|
Remove a range of elements from a vector.
Note This operation could be expensive and if it is frequently used the user should consider using std::list. The user is also cautioned that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibilty. Definition at line 670 of file stl_vector.h. |
|
Remove element at given position.
Note This operation could be expensive and if it is frequently used the user should consider using std::list. The user is also cautioned that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibilty. Definition at line 647 of file stl_vector.h. Referenced by std::vector< _Node *, _Alloc >::clear(), and std::vector< _Node *, _Alloc >::resize(). |
|
Returns a read-only (constant) reference to the data at the first element of the vector. Definition at line 467 of file stl_vector.h. |
|
Returns a read/write reference to the data at the first element of the vector. Definition at line 461 of file stl_vector.h. |
|
Inserts a number of copies of given data into the vector.
Note that this kind of operation could be expensive for a vector and if it is frequently used the user should consider using std::list. Definition at line 614 of file stl_vector.h. |
|
Inserts an empty element into the vector.
Definition at line 565 of file stl_vector.h. |
|
Inserts given value into vector at specified element.
Definition at line 541 of file stl_vector.h. Referenced by std::vector< _Node *, _Alloc >::resize(). |
|
Returns the size of the largest possible vector. Definition at line 264 of file stl_vector.h. Referenced by std::vector< _Node *, _Alloc >::reserve(). |
|
Subscript access to the data contained in the vector.
Definition at line 300 of file stl_vector.h. |
|
Subscript access to the data contained in the vector.
Definition at line 289 of file stl_vector.h. |
|
Removes last element from vector. This is a typical stack operation. It allows us to shrink the vector by one. Note that no data is returned and if last element's data is needed it should be retrieved before pop_back() is called. Definition at line 628 of file stl_vector.h. |
|
Add an element to the end of the vector. The element is default-constructed.
Definition at line 510 of file stl_vector.h. |
|
Add data to the end of the vector.
Definition at line 491 of file stl_vector.h. |
|
Returns a read-only (constant) reverse iterator that points to the last element in the vector. Iteration is done in reverse element order. Definition at line 240 of file stl_vector.h. |
|
Returns a read/write reverse iterator that points to the last element in the vector. Iteration is done in reverse element order. Definition at line 233 of file stl_vector.h. |
|
Returns a read-only (constant) reverse iterator that points to one before the first element in the vector. Iteration is done in reverse element order. Definition at line 256 of file stl_vector.h. |
|
Returns a read/write reverse iterator that points to one before the first element in the vector. Iteration is done in reverse element order. Definition at line 248 of file stl_vector.h. |
|
Attempt to preallocate enough memory for specified number of elements.
The advantage of this function is that if optimal code is a necessity and the user can determine the number of elements that will be required the user can reserve the memory and thus prevent a possible reallocation of memory and copy of vector data. Definition at line 393 of file stl_vector.h. |
|
Resizes the vector to the specified number of elements.
Definition at line 703 of file stl_vector.h. |
|
Resizes the vector to the specified number of elements.
Definition at line 687 of file stl_vector.h. Referenced by std::vector< _Node *, _Alloc >::resize(). |
|
Returns the number of elements in the vector. Definition at line 260 of file stl_vector.h. Referenced by std::vector< _Node *, _Alloc >::reserve(), and std::vector< _Node *, _Alloc >::resize(). |