Tools.h++ Class Reference

Table Of Contents
size_type
entries() const;
Returns the number of associations in self.
float
fillRatio() const;
Returns the ratio entries()/capacity().
bool
find(const K& key, K& r) const;
If there exists a key j in self that compares equal to key, assigns j to r and returns true.
Otherwise, returns false and leaves the value of r unchanged.
bool
find(bool (*fn)(const_reference,void*),void* d,
pair<K,T>& r) const;
If there exists an association a in self such that the expression ((*fn)(a,d)) is true, assigns
a to r and returns true. Otherwise, returns false and leaves the value of k unchanged. fn
points to a user-defined tester function which must have prototype:
bool yourTester(const K& a, void* d);
Client data may be passed through parameter d.
bool
findValue(const K& key, T& r) const;
If there exists a key j in self that compares equal to key, assigns the item associated with j
to r and returns true. Otherwise, returns false and leaves the value of r unchanged.
bool
findKeyValue(const K& key, K& kr, T& tr) const;
If there exists a key j in self that compares equal to key, assigns j to kr, assigns the item
associated with j to tr, and returns true. Otherwise, returns false and leaves the values of
kr and tr unchanged.
bool
insert(const K& key, const T& a);
Adds key with associated item a to the collection. Returns true if the insertion is
successful, otherwise returns false. The function will return true unless the collection
already holds an association with the equivalent key.
bool
insertKeyAndValue(const K& key,const T& a);
This is a deprecated version of the insert member above. It behaves exactly the same as
insert.
bool