Standard C++ Library Class Reference
Description
Insert iterators let you insert new elements into a collection rather than copy a new element's
value over the value of an existing element. The class insert_iterator is used to insert items into
a specified location of a collection. The function inserter creates an instance of an
insert_iterator given a particular collection type and iterator. An insert_iterator can be used
with vectors, deques, lists, maps and sets.
Interface
template <class Container>
class insert_iterator : public output_iterator {
public:
insert_iterator (Container&, typename Container::iterator);
insert_iterator<Container>&
operator= (const typename Container::value_type&);
insert_iterator<Container>& operator* ();
insert_iterator<Container>& operator++ ();
insert_iterator<Container>& operator++ (int);
};
template <class Container, class Iterator>
insert_iterator<Container> inserter (Container&, Iterator)
Constructor
insert_iterator (Container& x, typename Container::iterator i);
Constructor. Creates an instance of an insert_iterator associated with container x and
iterator i.
Operators
insert_iterator<Container>&
operator= (const typename Container::value_type& value);
Assignment operator. Inserts a copy of value into the container at the location specified
by the insert_iterator, increments the iterator, and returns *this.
insert_iterator<Container>&
operator* ();
Returns *this (the input iterator itself).
insert_iterator<Container>&
operator++ ();
insert_iterator<Container>&