Lecture overview -- Keyboard shortcut: 'u'  Previous page: Categories of iterators -- Keyboard shortcut: 'p'  Next page: Standard Containers [Section] -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 5 - Page 21 : 39
Notes about C++
Templates and The Standard Library
Insert iterators

Many algorithms overwrites existing elements

It is also necessary to be able to insert new elements

Insertion is done by the container operations push_back(), push_front(), and insert()

Insertion can also be accomplished via insert-iterators, which are output iterators

Insertion iterators can be created by the template (factory) functions back_inserter, front_inserter, and inserter.

Using these, assignments are used for inserting new elements

  • The C++ Programming Language: Page 555
 

y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/iterators/inserters/ins-2.cppOutput insert-iterators and factory functions that create such iterators.