Tools.h++ Class Reference

Table Of Contents
Persistence
Isomorphic
Example
In this example, a sorted vector of RWDates is exercised.
//
// tvsvcdat.cpp
//
#include <rw/tvsrtvec.h>
#include <rw/rwdate.h>
#include <iostream.h>
main(){
RWTValSortedVector<RWDate, less<RWDate> > vec;
vec.insert(RWDate(10, "Aug", 1991));
vec.insert(RWDate(9, "Aug", 1991));
vec.insert(RWDate(1, "Sep", 1991));
vec.insert(RWDate(14, "May", 1990));
vec.insert(RWDate(1, "Sep", 1991)); // Add a duplicate
vec.insert(RWDate(2, "June", 1991));
for (int i=0; i<vec.entries(); i++)
cout << vec[i] << endl;
return 0;
}
Program Output:
05/14/90
06/02/91
08/09/91
08/10/91
09/01/91
09/01/91
Related Classes
RWTValSortedDlist<T,C> is an alternative always-sorted collection.
RWTValOrderedVector<T> is an unsorted vector of values.
Class vector<T,allocator> is the C++-standard collection that serves as the underlying
implementation for this class.