insert

The insert for multi-hashed containers functions hash_multiset and hash_multimap have the following insert methods.

  iterator insert(const value_type& x);

  iterator insert(iterator p, const value_type& x);

  template <class InputIterator> void insert

  (InputIterator first, InputIterator last);  
Remarks

In the first insert prototype x is inserted into the container and an iterator pointing to the newly inserted value is returned. If values equal to x already exist in the container, then the new element is inserted after all other equal elements. This ordering is stable throughout the lifetime of the container.

In the second prototype insert first checks to see if *p is equivalent to x according to the compare function. If it is, then x is inserted before p. If not then x is inserted as if the insert without an iterator was used. An iterator is returned which points to the newly inserted element.

The final insert prototype inserts (first, last) into the container. Equal elements will be ordered according to which was inserted first.