Tools.h++ Manual

104011 Tandem Computers Incorporated 22-77
22
Program output:
The list does contain a Schnauzer
Cairn Terrier
Fox Terrier
Irish Terrier
Schnauzer
Public constructors
RWTValDlist<T>();
Construct an empty list.
RWTValDlist<T>(const RWTValDlist<T>& list);
Construct 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.
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
TOOL_INDEX
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.
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
TOOL_INDEX
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);