Tools.h++ Class Reference

Table Of Contents
well-defined equality semantics (T::operator==(const T&)).
Persistence
Isomorphic
Example
In this example, a singly-linked list of RWDates is exercised.
#include <rw/tpslist.h>
#include <rw/rwdate.h>
#include <rw/rstream.h>
main() {
RWTPtrSlist<RWDate> dates;
dates.insert(new RWDate(2, "June", 52)); // 6/2/52
dates.insert(new RWDate(30, "March", 46)); // 3/30/46
dates.insert(new RWDate(1, "April", 90)); // 4/1/90
// Now look for one of the dates:
RWDate key(2, "June", 52);
RWDate* d = dates.find(&key);
if (d){
cout << "Found date " << *d << endl;
}
// Remove in reverse order:
while (!dates.isEmpty()){
d = dates.removeLast();
cout << *d << endl;
delete d;
}
return 0;
}
Program output:
Found date June 2, 1952
April 1, 1990
March 30, 1946
June 2, 1952
Public Constructors
RWTPtrSlist<T>();
Construct an empty list.
RWTPtrSlist<T>(const RWTPtrSlist<T>& c);