C++ Language/Std/Stl/Iterators/InsertIterators

Algorithm  has already been written by STL to call operators   and   on both source and destination iterators (overwriting destination items with data copied from source items). As such, that algorithm assumes the destination collection must already have at least as many items as the source collection.

A  "insert-iterator" is intermediary code which allows that same implementation of   to be used with an empty destination collection. That insert-iterator achieves this by re-defining the effect of operators  and. Operator  now has the effect of , and operator   now does nothing.

Additional information about insert-iterators (includes interactive examples)