Neat Vectors
5
Hanes
|
A (very neat) vector. More...
#include <vector.h>
Public Member Functions | |
Vector () | |
Constructs an empty vector. More... | |
Vector (const Vector< FUN > &v) | |
Copy Constructor. More... | |
~Vector () | |
Destructor. | |
void | push_back (FUN v) |
Add elements to the vector. More... | |
FUN & | operator[] (const unsigned int idx) |
Reads an element of the vector. More... | |
const FUN & | operator[] (const unsigned int idx) const |
Reads an element of the vector. More... | |
unsigned int | length () const |
The number of items stored in the vector. More... | |
unsigned int | size () const |
The size of the underlying storage. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<class FUN > | |
ostream & | operator<< (ostream &out, const Vector< FUN > &v) |
Stream insertion operator for Vector . More... | |
A (very neat) vector.
It's a vector. You put stuff into it, you get stuff out of it, that's about it.
Constructs an empty vector.
Copy Constructor.
unsigned int Vector< FUN >::length | ( | ) | const |
The number of items stored in the vector.
FUN & Vector< FUN >::operator[] | ( | const unsigned int | idx | ) |
Reads an element of the vector.
idx | the index of the element to read. |
std::invalid_argument | is thrown if idx is out of range. |
const FUN & Vector< FUN >::operator[] | ( | const unsigned int | idx | ) | const |
Reads an element of the vector.
idx | the index of the element to read. |
std::invalid_argument | is thrown if idx is out of range. |
void Vector< FUN >::push_back | ( | FUN | v | ) |
Add elements to the vector.
unsigned int Vector< FUN >::size | ( | ) | const |
The size of the underlying storage.
|
related |
Stream insertion operator for Vector
.
FUN
.