Insert For Unique Hashed Containers
hash_set and hash_map
have the following insert method:
std::pair<iterator, bool> insert(const value_type& x);
If x does not already exist in the container, it will be inserted. The returned iterator will point to the newly inserted x, and the bool will be true. If x already exists in the container, the container is unchanged. The returned iterator will point to the element that is equal to x, and the bool will be false.
iterator insert(iterator, const value_type& x);
Operates just like the version taking only a value_type. The iterator argument is ignored. It is only present for compatibility with standard containers.
template <class InputIterator> void insert
(InputIterator first, InputIterator last);
Inserts those elements in (first, last) that don't already exist in the container.