C++ Standard Library back_insert_iterator Sample

Description

back_insert_iterator is a template class used to insert new elements at the end of a sequence. It is used with the helper function back_inserter, in cases where you want to grow a container by adding new elements.

Declaration

	template <class Cont>
	    class back_insert_iterator : public iterator;

Concept

The sample program sets up a vector of integers, and then adds two elements to it. An insertion iterator is retrieved, and is used to insert elements at the end of the vector. The operators * and ++ are used to make the actual insertion. The output of the program is 5 17 23 11 16.

Supported
Supported
Supported