Standard C++ Library Reference ISO/IEC (VERSION3)
hash_map::hash_map
hash_map();
explicit hash_map(const Tr& traits);
hash_map(const Tr& traits, const Alloc& al);
hash_map(const hash_map& right);
template<class InIt>
hash_map(InIt first, InIt last);
template<class InIt>
hash_map(InIt first, InIt last,
const Tr& traits);
template<class InIt>
hash_map(InIt first, InIt last,
const Tr& traits, const Alloc& al);
All constructors store an allocator object and initialize the controlled sequence. The allocator
object is the argument al, if present. For the copy constructor, it is
right.get_allocator(). Otherwise, it is Alloc().
All constructors also store a hash traits object that can later be returned by calling
key_comp(). The hash traits object is the argument traits, if present. For the copy
constructor, it is right.key_comp()). Otherwise, it is Tr().
The first three constructors specify an empty initial controlled sequence. The fourth constructor
specifies a copy of the sequence controlled by right. The last three constructors specify the
sequence of element values [first, last).
hash_map::insert
pair<iterator, bool> insert(const value_type& val);
iterator insert(iterator where, const value_type& val);
template<class InIt>
void insert(InIt first, InIt last);
The first member function determines whether an element X exists in the sequence whose key
has equivalent ordering to that of val. If not, it creates such an element X and initializes it with
val. The function then determines the iterator where that designates X. If an insertion
occurred, the function returns pair(iter, true). Otherwise, it returns pair(where,
false).
The second member function returns insert(val).first, using where as a starting place
within the controlled sequence to search for the insertion point. (Insertion can possibly occur
somewhat faster, if the insertion point immediately precedes or follows where.) The third
member function inserts the sequence of element values, for each where in the range
[first, last), by calling insert(*where).