Name

inserter function template — Creates an insert_iterator

Synopsis

template <typename Container, typename Iterator>
  insert_iterator<Container>
    inserter(Container& x, Iterator i);

The inserter function template constructs an insert_iterator object for the container x to insert items starting at position i. Figure 13-22 illustrates a simple use of the inserter function.

Using inserter to insert a vector in the middle of another vector
Figure 13-22. Using inserter to insert a vector in the middle of another vector

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.