Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

back_insert_iterator, back_inserter()

Library:  Iterators


back_insert_iterator iterator

Local Index

Members

Summary

An output iterator used to insert items at the end of a collection

Synopsis

#include <iterator>

namespace std {
  template <class Container> 
  class back_insert_iterator;
}

Description

Insert iterators let you insert new elements into a collection rather than copy a new element's value over the value of an existing element. The class template specialization back_insert_iterator is used to insert items at the end of a collection. The convenience function template back_inserter() creates an instance of a back_insert_iterator for a particular collection type. A back_insert_iterator can be used with any container that defines the push_back() member function, specifically all sequences (e.g., vector, deque, basic_string, and list), but not with associative containers (e.g., map or set).

Interface

Member Types

container_type

Constructors

explicit
back_insert_iterator (container_type& x);

Operators

back_insert_iterator&
operator= (const typename container_type::constant_reference value);
back_insert_iterator&
operator* ();
back_insert_iterator& 
operator* ();
back_insert_iterator& 
operator++ ();
back_insert_iterator 
operator++ (int);

Helper Functions

template <class Container>
back_insert_iterator<Container>
back_inserter (Container& x)

Example

See Also

Insert Iterators

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 24.4.2.1



Previous fileTop of DocumentContentsIndex pageNext file