Tools.h++ Class Reference

Table Of Contents
Returns true if the collection is sorted relative to the supplied comparator object, false
otherwise.
T*&
last();
T* const&
last() const;
Returns a reference to the last item in the collection.
size_type
merge(const RWTPtrSortedDlist<T,C>& dl);
Inserts all elements of dl into self, preserving sorted order. Returns the number of items
inserted.
size_type
occurrencesOf(const T* a) const;
Returns the number of elements t in self such that the expression (*t == *a) is true.
size_type
occurrencesOf(bool (*fn)(const T*,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 T* a, void* d);
Client data may be passed through parameter d.
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)(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);