Tools.h++ Class Reference

Table Of Contents
Returns the number of elements t in self such that the expression((*fn)(t,d)) is true. fn
points to a user-defined tester function which must have one of the prototypes:
bool yourTester(T* a, void* d);
bool yourTester(const T* a, void* d);
for the const version. Client data may be passed through parameter d.
void
prepend(T* a);
Adds the item a to the beginning of the collection.
T*
remove(const T* a);
Removes and returns the first element t in self such that the expression (*t == *a) is true.
Returns rwnil if there is no such element.
T*
remove(bool (*fn)( T*,void*), void* d);
T*
remove(bool (*fn)(const T*,void*), void* d);
Removes and returns the first element t in self such that the expression ((*fn)(t,d)) is true.
Returns rwnil if there is no such element. fn points to a user-defined tester function which
must have one of the prototypes:
bool yourTester(T* a, void* d);
bool yourTester(const T* a, void* d);
Client data may be passed through parameter d.
size_type
removeAll(const T* a);
Removes all elements t in self such that the expression (*t == *a) is true. Returns the
number of items removed.
size_type
removeAll(bool (*fn)( T*,void*), void* d);
size_type
removeAll(bool (*fn)(const T*,void*), void* d);
Removes all elements t in self such that the expression ((*fn)(t,d))is true. Returns the
number of items removed. fn points to a user-defined tester function which must have
one of the prototypes:
bool yourTester(T* a, void* d);
bool yourTester(const T* a, void* d);
for the const version. Client data may be passed through parameter d.
T*