A front 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 front of the container.
Parameters
- x
- Container for which the front insert iterator is constructed.
Return value
A front_insert_iterator that inserts elements at the beginning 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:
50 40 30 20 10 1 2 3 4 5 |
See also
| front_insert_iterator | Front insert iterator (class template) |
| back_inserter | Construct a back insert iterator (function template) |
| inserter | Construct an insert iterator (function template) |
