Nugget
|
#include <iterator.h>
Public Types | |
typedef Container | container_type |
typedef Container::iterator | iterator_type |
typedef Container::const_reference | const_reference |
Public Types inherited from eastl::iterator< EASTL_ITC_NS::output_iterator_tag, void, void, void, void > | |
typedef EASTL_ITC_NS::output_iterator_tag | iterator_category |
typedef void | value_type |
typedef void | difference_type |
typedef void | pointer |
typedef void | reference |
Public Member Functions | |
insert_iterator & | operator= (const insert_iterator &x) |
insert_iterator (Container &x, iterator_type itNew) | |
insert_iterator & | operator= (const_reference value) |
insert_iterator & | operator* () |
insert_iterator & | operator++ () |
insert_iterator & | operator++ (int) |
Protected Attributes | |
Container & | container |
iterator_type | it |
An insert_iterator is like an iterator except that when you assign a value to it, the insert_iterator inserts the value into the container and increments the iterator.
insert_iterator is an iterator adaptor that functions as an OutputIterator: assignment through an insert_iterator inserts an object into a container. Specifically, if ii is an insert_iterator, then ii keeps track of a container c and an insertion point p; the expression *ii = x performs the insertion container.insert(p, x).
If you assign through an insert_iterator several times, then you will be inserting several elements into the underlying container. In the case of a sequence, they will appear at a particular location in the underlying sequence, in the order in which they were inserted: one of the arguments to insert_iterator's constructor is an iterator p, and the new range will be inserted immediately before p.