Back Insertion Sequence. [1]
list<int> L;
L.push_front(3);
back_insert_iterator<list<int> > ii(L);
*ii++ = 0;
*ii++ = 1;
*ii++ = 2;
copy (L.begin(), L.end(), ostream_iterator<int>(cout, ' '));
// The values that are printed are 3 0 1 2
Defined in the standard header iterator, and in the nonstandard backward-compatibility header iterator.h.
| Parameter | Description |
|---|---|
BackInsertionSequence | The type of Back Insertion Sequence into which values will be inserted. |
Output Iterator. An insert iterator's set of value types (as defined in the Output Iterator requirements) consists of a single type:
The template parameter
None.
| Member | Where defined | Description |
|---|---|---|
back_insert_iterator(BackInsertionSequence&) | back_insert_iterator | See below. |
back_insert_iterator(const back_insert_iterator&) | Trivial Iterator | The copy constructor |
back_insert_iterator& operator=(const back_insert_iterator&) | Trivial Iterator | The assignment operator |
back_insert_iterator& operator*() | Output Iterator | Used to implement the output iterator expression |
back_insert_iterator& operator=(const BackInsertionSequence::value_type&) | Output Iterator | Used to implement the output iterator expression |
back_insert_iterator& operator++() | Output Iterator | Preincrement. |
back_insert_iterator& operator++(int) | Output Iterator | Postincrement. |
output_iterator_tag iterator_category(const back_insert_iterator&) | iterator tags | Returns the iterator's category. This is a global function, not a member. |
template<class BackInsertionSequence> back_insert_iterator<BackInsertionSequence> back_inserter(BackInsertionSequence& S) | back_insert_iterator | See below. |
These members are not defined in the Output Iterator requirements, but are specific to
| Member function | Description |
|---|
Вы читаете Standard Template Library Programmer's Guide
