Tools.h++ Class Reference

Table Of Contents
Adds the item a to self. The collection remains sorted. Returns true.
size_type
insert(const vector<T*,allocator>& a);
Inserts all elements of a into self. The collection remains sorted. Returns the number of
items inserted.
bool
isEmpty() const;
Returns true if there are no items in the collection, false otherwise.
bool
isSorted() const;
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. If the collection is empty, the
function throws an exception of type RWBoundsErr.
size_type
length() const;
Returns the number of elements in self.
size_type
merge(const RWTPtrSortedVector<T,C>& vec);
Inserts all elements of vec 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);