Tools.h++ Class Reference

Table Of Contents
The class T must have:
well-defined copy semantics (T::T(const T&) or equivalent);
well-defined assignment semantics (T::operator=(const T&) or equivalent);
well-defined equality semantics (T::operator==(const T&)).
Persistence
None
Example
This examples exercises a set of RWCStrings.
#include <rw/tvhset.h>
#include <rw/cstring.h>
#include <rw/rstream.h>
main(){
RWTValHashSet<RWCString> set(RWCString::hash);
set.insert("one");
set.insert("two");
set.insert("three");
set.insert("one"); // Rejected: already in collection
cout << set.entries() << endl; // Prints "3"
return 0;
}
Program output:
3
Public Member Functions
RWTValHashSet<T>&
Union(const RWTValHashSet<T>& h);
Computes the union of self and h, modifying self and returning self.
RWTValHashSet<T>&
difference(const RWTValHashSet<T>& h);
Computes the disjunction of self and h, modifying self and returning self.
RWTValHashSet<T>&
intersection(const RWTValHashSet<T>& h);
Computes the intersection of self and h, modifying self and returning self.
RWTValHashSet<T>&