insert_iterator::container_type
表示容器泛型插入将进行的类型。
typedef Container container_type;
备注
该类型是模板参数的 Container同义词。
示例
// insert_iterator_container_type.cpp
// compile with: /EHsc
#include <iterator>
#include <list>
#include <iostream>
int main( )
{
using namespace std;
list<int> L1;
insert_iterator<list<int> >::container_type L2 = L1;
inserter ( L2, L2.end ( ) ) = 20;
inserter ( L2, L2.end ( ) ) = 10;
inserter ( L2, L2.begin ( ) ) = 40;
list <int>::iterator vIter;
cout << "The list L2 is: ( ";
for ( vIter = L2.begin ( ) ; vIter != L2.end ( ); vIter++ )
cout << *vIter << " ";
cout << ")." << endl;
}
要求
标头: <iterator>
命名空间: std