Tools.h++ Class Reference

Table Of Contents
Removes and returns the first item in the collection.
size_type
replaceAll(const T* oldVal,T* newVal);
Replaces with newVal all elements t in self such that the expression (*t == *oldVal) is
true. Returns the number of items replaced.
size_type
replaceAll(bool (*fn)(T*, void*),void* x,T* newVal);
size_type
replaceAll(bool (*fn)(const T*, void*),void* x,T* newVal);
Replaces with newVal all elements t in self such that the expression ((*fn)(t,d))is true.
Returns the number of items replaced. 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.
void
sort();
Sorts the collection using the less-than operator to compare elements. Elements are
dereferenced before being compared.
rw_slist<T*>&
std();
const rw_slist<T*>&
std() const;
Returns a reference to the underlying C++-standard collection that serves as the
implementation for self.
Static Public Data Member
const size_type npos;
This is the value returned by member functions such as index to indicate a non-position.
The value is equal to ~(size_type)0.
Related Global Operators
RWvostream&
operator<<(RWvostream& strm, const RWTPtrSlist<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrSlist<T>& coll);
Saves the collection coll onto the output stream strm, or a reference to it if it has already