A back insert iterator is a special type of output iterator specifically designed to allow algorithms that usually overwrite elements (such as copy) to instead insert new elements at the end of the container.
Parameters
- x
- Container for which the back insert iterator is constructed.
Return value
A back_insert_iterator that inserts elements at the end of container x.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Output:
1 2 3 4 5 10 20 30 40 50 |
See also
| back_insert_iterator | Back insert iterator (class template) |
| front_inserter | Constructs a front insert iterator (function template) |
| inserter | Construct an insert iterator (function template) |
