Tools.h++ Class Reference

Table Of Contents
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 the expression (j == key) is true
and returns true. Returns false if there is no such association.
bool
remove(bool (*fn)(const_reference,void*), void* d);
Removes the first association a in self such that the expression ((*fn)(a,d)) is true and
returns true. Returns false if there is no such element. 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.
size_type
removeAll(const K& key);
Removes all elements j in self that compare equal to key. Returns the number of items
removed.
size_type
removeAll(bool (*fn)(const_reference,void*), void* d);
Removes all associations a in self such that the expression ((*fn)(a,d))is true. Returns the
number of items removed. 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.
void
resize(size_type sz);