insert_iterator::reference
提供的項目參考在順序由關聯的容器的型別。
typedef typename Container::reference reference;
備註
型別描述之項目的參考順序由關聯的容器。
範例
// insert_iterator_container_reference.cpp
// compile with: /EHsc
#include <iterator>
#include <list>
#include <iostream>
int main( )
{
using namespace std;
list<int> L;
insert_iterator<list<int> > iivIter( L , L.begin ( ) );
*iivIter = 10;
*iivIter = 20;
*iivIter = 30;
list<int>::iterator LIter;
cout << "The list L is: ( ";
for ( LIter = L.begin ( ) ; LIter != L.end ( ); LIter++ )
cout << *LIter << " ";
cout << ")." << endl;
insert_iterator<list<int> >::reference
RefFirst = *(L.begin ( ));
cout << "The first element in the list L is: "
<< RefFirst << "." << endl;
}
需求
標頭:<迭代器>
命名空間: std