Tools.h++ Class Reference

Table Of Contents
!comp(a,b) && !comp(b,a).
Persistence
Isomorphic.
Examples
In this example, a pointer-based set of RWCStrings is exercised.
//
//tpset.cpp
//
#include <rw/tpset.h>
#include <rw/cstring.h>
#include <iostream.h>
#include <function.h>
main(){
RWTPtrSet<RWCString, less<RWCString> > set;
set.insert(new RWCString("one"));
set.insert(new RWCString("two"));
set.insert(new RWCString("three"));
set.insert(new RWCString("one")); // Rejected: duplicate entry
cout << set.entries() << endl; // Prints "3"
set.clearAndDestroy();
cout << set.entries() << endl; // Prints "0"
return 0;
}
Related Classes
Class RWTPtrMultiSet<T,C> offers the same interface to a pointer-based collection that accepts multiple
items that compare equal to each other. RWTPtrMap<K,T,C> is a pointer-based collection of key-value pairs.
Class set<T*,rw_deref_compare<C,T>,allocator> is the C++-standard collection that serves as the underlying
implementation for RWTPtrSet<T,C>.
Public Typedefs
typedef rw_deref_compare<C,T> container_comp;
typedef set<T*, container_comp,allocator> container_type;
typedef container_type::size_type size_type;
typedef container_type::difference_type difference_type;
typedef container_type::iterator iterator;
typedef container_type::const_iterator const_iterator;
typedef T* value_type;
typedef T*const& reference;