#include <vector.h>
Public Member Functions | |
Vector () | |
Vector (const unsigned, const T &=T()) throw ( bad_alloc ) | |
Vector (const Vector< T > &) throw ( bad_alloc ) | |
~Vector () | |
bool | empty () const |
unsigned | size () const |
unsigned | capacity () const |
void | clear () |
void | resize (const unsigned, const T &=T()) throw ( bad_alloc ) |
T & | at (const unsigned) const throw ( VectorEmpty, OutOfBounds ) |
void | assign (const unsigned, const T &) throw ( VectorEmpty, OutOfBounds ) |
void | push_back (const T &) throw ( bad_alloc ) |
void | insert (const unsigned, const T &) throw ( bad_alloc, OutOfBounds ) |
void | remove (const unsigned) throw ( VectorEmpty, OutOfBounds ) |
T & | operator[] (const unsigned) const throw ( VectorEmpty, OutOfBounds ) |
const T & | operator= (const Vector< T > &) throw ( bad_alloc ) |
|
Default constructor. |
|
Constructor for initializing a vector to a fixed size and containing a given value.
|
|
Copy constructor.
|
|
Class destructor. |
|
Assigns the object to the specified position in the vector.
|
|
Returns a reference to the object stored at a given position in the vector.
|
|
Returns the capacity of the vector, which is the number of elements that the vector can store before increasing the capacity.
|
|
Removes the elements of the vector. |
|
Returns true if the vector is empty; returns false otherwise.
|
|
Inserts the object at the given position. Increases capacity if necessary.
|
|
Returns a deep copy of the vector passed in as the parameter.
|
|
Returns a reference to the object stored at a given position in the vector.
|
|
Adds the object to the end of the vector. Increases capacity if necessary.
|
|
Removes the object stored in the given position.
|
|
Resizes the vector to its new size. After allocating new memory and copy the contents of old memory, stores the value in any unassigned elements.
|
|
Returns the size (i.e., the number of elements) of the vector.
|