Tools.h++ Class Reference

Table Of Contents
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)(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 prototype:
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)(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
prototype:
bool yourTester(const T* a, void* d);
Client data may be passed through parameter d.
T*
removeAt(size_type i);
Removes and returns the item at position i in self. This position must be between zero
and one less then the number of entries in the collection, otherwise the function throws an
exception of type RWBoundsErr.
T*
removeFirst();
Removes and returns the first item in the collection. If the collection is empty, the
function throws an exception of type RWBoundsErr.
T*
removeLast();
Removes and returns the first item in the collection.
void
resize(size_type n);
Modify, if necessary, the capacity of the vector to be at least as large as n.
const vector<T*,allocator>&
std() const;