Looking up an element in a hash_map by its key is efficient,
so hash_map is useful for "dictionaries" where the
order of elements is irrelevant. If it is important for the elements
to be in a particular order, however, then
map is more appropriate.

Returns a reference to the object that is associated with
a particular key. If the hash_map does not already contain such
an object, operator[] inserts the default object data_type(). [3]

Notes

[1]Hash_map::iterator is not a mutable iterator, because
hash_map::value_type is not Assignable. That is, if i is of
type hash_map::iterator and p is of type
hash_map::value_type, then *i = p is not a valid
expression. However, hash_map::iterator isn't a constant
iterator either, because it can be used to modify the object that it
points to. Using the same notation as above, (*i).second = p
is a valid expression.

[2]
This member function relies on member template functions, which
at present (early 1998) are not supported by all compilers. If your
compiler supports member templates, you can call this function with
any type of input iterator. If your
compiler does not yet support member templates, though, then the
arguments must either be of type const value_type* or of type
hash_map::const_iterator.

[3]
Since operator[] might insert a new element into the
hash_map, it can't possibly be a const member
function. Note that the definition of operator[] is
extremely simple: m[k] is equivalent to
(*((m.insert(value_type(k, data_type()))).first)).second.
Strictly speaking, this member function is unnecessary: it exists only
for convenience.