libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ inserter() [2/2]

template<typename _Container>
insert_iterator< _Container > std::inserter ( _Container & __x,
std::__detail::__range_iter_t< _Container > __i )
nodiscardconstexpr
Parameters
__xA container of arbitrary type.
__iAn iterator into the container.
Returns
An instance of insert_iterator working on __x.

This wrapper function helps in creating insert_iterator instances. Typing the name of the iterator requires knowing the precise full type of the container, which can be tedious and impedes generic programming. Using this function lets you take advantage of automatic template parameter deduction, making the compiler match the correct types for you.

Definition at line 999 of file bits/stl_iterator.h.

1000 { return insert_iterator<_Container>(__x, __i); }
Turns assignment into insertion.

References inserter().

Referenced by std::deque< _Tp, _Alloc >::_M_range_insert_aux(), and inserter().

Here is the call graph for this function:
Here is the caller graph for this function: