std::inserter (3) - Linux Manuals
std::inserter: std::inserter
NAME
Synopsis
Defined in header <iterator>
template< class Container > (until C++20)
std::insert_iterator<Container> inserter( Container& c, typename Container::iterator i );
template< class Container > (since C++20)
constexpr std::insert_iterator<Container> inserter( Container& c, ranges::iterator_t<Container> i );
inserter is a convenience function template that constructs a std::insert_iterator for the container c and its iterator i with the type deduced from the type of the argument.
Parameters
c - container that supports a insert operation
i - iterator in c indicating the insertion position
Return value
A std::insert_iterator which can be used to insert elements into the container c at the position indicated by i.
Possible implementation
Example
// Run this code
Output:
See also
insert_iterator (class template)
back_inserter (function template)
front_inserter (function template)