Tools.h++ Class Reference

Table Of Contents
Public Constructor
RWTValOrderedVector<T>(size_t capac=RWDEFAULT_CAPACITY);
Create an empty ordered vector with capacity capac. Should the number of items exceed this
value, the vector will be resized automatically.
RWTValOrderedVector<T>(const RWTValOrderedVector<T>& c);
Constructs a new ordered vector as a copy of c. The copy constructor of all elements in the vector
will be called. The new vector will have the same capacity and number of members as the old
vector.
Public Operators
RWTValOrderedVector<T>&
operator=(const RWTValOrderedVector& c);
Sets self to a copy of c. The copy constructor of all elements in the vector will be called. Self will
have the same capacity and number of members as the old vector.
T&
operator()(size_t i);
const T&
operator()(size_t i) const;
Returns the ith value in the vector. The first variant can be used as an lvalue, the second cannot.
The index i must be between zero and the number of items in the collection less one. No bounds
checking is performed.
T&
operator[](size_t i);
const T&
operator[](size_t i) const;
Returns the ith value in the vector. The first variant can be used as an lvalue, the second cannot.
The index i must be between zero and the number of items in the collection less one, or an
exception of type RWBoundsError will be thrown.
Public Member Functions
void
append(const T& a);
Appends the value a to the end of the vector. The collection will automatically be resized if this
causes the number of items in the collection to exceed the capacity.
T&
at(size_t i);
const T&
at(size_t i) const;
Return the ith value in the vector. The first variant can be used as an lvalue, the second cannot.
The index i must be between 0 and the length of the vector less one or an exception of type