Tools.h++ Class Reference

Table Of Contents
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
isEmpty() const;
Returns true if there are no items in the collection, false otherwise.
size_type
occurrencesOf(const K& key) const;
Returns the number of keys j in self that compare equal to key.
size_type
occurrencesOf
(bool (*fn)(const_reference&,void*),void* d) const;
Returns the number of associations a in self such that the expression((*fn)(a,d)) is true. fn
points to a user-defined tester function which must have prototype:
bool yourTester(const_reference& a, void* d);
Client data may be passed through parameter d.
bool
remove(const K& key);
Removes the first association with key j in self such that j compares equal to key and
returns true. Returns false if there is no such association.
bool