back_insert_iterator::container_type
Typ, który stanowi kontener dla back_insert_iterator.
typedef Container container_type;
Uwagi
Typ jest synonimem parametru kontenera.
Przykład
// back_insert_iterator_container_type.cpp
// compile with: /EHsc
#include <iterator>
#include <vector>
#include <iostream>
int main( )
{
using namespace std;
int i;
vector<int> vec;
for (i = 1 ; i < 4 ; ++i )
{
vec.push_back ( i );
}
vector <int>::iterator vIter;
cout << "The original vector vec is: ( ";
for ( vIter = vec.begin ( ) ; vIter != vec.end ( ); vIter++)
cout << *vIter << " ";
cout << ")." << endl;
back_insert_iterator<vector<int> >::container_type vec1 = vec;
back_inserter ( vec1 ) = 40;
cout << "After the insertion, the vector is: ( ";
for ( vIter = vec1.begin ( ) ; vIter != vec1.end ( ); vIter++)
cout << *vIter << " ";
cout << ")." << endl;
}
Wymagania
Nagłówek: <iterator>
Obszar nazw: std