Tools.h++ Class Reference

Table Of Contents
Public Operators
RWTValDlist&
operator=(const RWTValDlist<T>& list);
Sets self to a copy of the list list. Depending on the nature of the copy constructor of T, this could
be relatively expensive because every item in the list must be copied.
T&
operator[](size_t i);
Returns a reference to the item at index i. The results can be used as an lvalue. An exception of
type RWBoundsError will be thrown if i is not a valid index. Valid indices are from zero to the
number of items in the list less one.
const T&
operator[](size_t i) const;
Returns a copy of the item at index i. The results cannot be used as an lvalue. An exception of
type RWBoundsError will be thrown if i is not a valid index. Valid indices are from zero to the
number of items in the list less one.
Public Member Functions
void
append(const T& a);
Adds the item a to the end of the list.
void
apply(void (*applyFun)(T&, void*), void* d);
Applies the user-defined function pointed to by applyFun to every item in the list. This function
must have prototype:
void yourFun(T& a, void* d);
Client data may be passed through as parameter d.
T&
at(size_t i);
Returns a reference to the item at index i. The results can be used as an lvalue. An exception of
type RWBoundsError will be thrown if i is not a valid index. Valid indices are from zero to the
number of items in the list less one.
const T&
at(size_t i) const;
Returns a copy of the item at index i. The results cannot be used as an lvalue. An exception of
type RWBoundsError will be thrown if i is not a valid index. Valid indices are from zero to the
number of items in the list less one.
void
clear();
Removes all items from the list. Their destructors (if any) will be called.