Tools.h++ Class Reference

Table Of Contents
Client data may be passed through parameter d.
bool
insert(const_reference a);
Adds the item a to the end of the collection. Returns true.
void
insertAt(size_type i, const_reference a);
Inserts the item a in front of the item at position i in self. This position must be between 0
and the number of entries in the collection, otherwise the function throws an exception of
type RWBoundsErr.
bool
isEmpty() const;
Returns true if there are no items in the collection, false otherwise.
reference
last();
const_reference
last() const;
Returns a reference to the last item in the collection.
reference
maxElement();
const_reference
maxElement() const;
reference
minElement();
const_reference
minElement() const;
Returns a reference to the minimum or maximum element in the collection. Type T must
have well-defined less-than semantics (T::operator<(const T&) or equivalent).
size_type
occurrencesOf(const_reference a) const;
Returns the number of elements t in self such that the expression (t == a) is true.
size_type
occurrencesOf(bool (*fn)(const_reference,void*),void* d) const;
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 prototype:
bool yourTester(const_reference a, void* d);
Client data may be passed through parameter d.
void