Tools.h++ Class Reference

Table Of Contents
size_type sz=1024,const H& h = H(),const EQ& eq = EQ());
Constructs a set by copying elements from the array of T*s pointed to by first, up to, but not
including, the element pointed to by last. The underlying hash table representation will have
sz buckets, will use h for its hashing function and will use eq to determine equality between
elements.
Public Member Operators
RWTPtrHashSet<T,H,EQ>&
operator=(const RWTPtrHashSet<T,H,EQ>& s);
Clears all elements of self and replaces them by copying all elements of s.
bool
operator==(const RWTPtrHashSet<T,H,EQ>& s) const;
Returns true if self compares equal to s, otherwise returns false. Two collections are equal if
both have the same number of entries, and iterating through both collections produces, in
turn, individual elements that compare equal to each other. Elements are dereferenced before
being compared.
Public Member Functions
void
apply(void (*fn)(const T*,void*), void* d) const;
Applies the user-defined function pointed to by fn to every item in the collection. self
function must have prototype:
void yourfun(const T* a, void* d);
Client data may be passed through parameter d.
iterator
begin();
const_iterator
begin() const;
Returns an iterator positioned at the first element of self.
size_type
capacity() const;
Returns the number of buckets(slots) available in the underlying hash representation. See
resize below.
void
clear();
Clears the collection by removing all items from self.
void
clearAndDestroy();