Tools.h++ Class Reference

Table Of Contents
returning 1. Otherwise, does nothing and returns 0. Note that the first argument is
provided only for conformance with the ANSI associative container specification, and is
ignored by the method, since hash table look up can be done in constant time.
size_type
insert(const value_type* first, const value_type* bound);
For each element in the range beginning with first and bounded by bound, if there is no
pair in self with first part EQ to the first part of that element, the element is copied into
self, or if there is such a pair, the element is skipped. Returns the number of elements
inserted.
size_type
insert(const_iterator first, const_iterator bound);
For each element in the range beginning with first and bounded by bound, if there is no
pair in self with first part EQ to the first part of that element, the element is copied into
self, or if there is such a pair, the element is skipped. Returns the number of elements
inserted.
void
swap(rw_hashmap<K,V,Hash,EQ>& other);
Exchanges the contents of self with other including the Hash and EQ objects. This
method does not copy or destroy any of the items exchanged but exchanges the
underlying hash tables.
Special Methods for Maps
size_type
count(const key_type& key) const;
Returns 1 if self contains a pair with its first element EQ to key, else 0.
bool
equal_by_keys(const rw_hashmap<K,V,Hash,EQ>& rhs) const;
Returns true if self and rhs have the same size, and if for each value_type in self, there is
a value_type in rhs such that the EQ object in self returns true when called for the first
parts of those pairs. Note that this method does not compare the V (second) part of the
pair of the items, so it will run slightly faster than operator==().
const_iterator
find(const key_type& key) const;
Returns a const_iterator referencing the pair with key as its first element if such a pair is
contained in self, else returns end().
iterator
find(const key_type& key);
Returns an iterator referencing the pair with key as its first element, if such a pair is