共用方式為


front_insert_iterator::reference

提供項目的參考於排序控制項相關的容器的型別。

typedef typename Container::reference reference;

範例

// front_insert_iterator_reference.cpp
// compile with: /EHsc
#include <iterator>
#include <list>
#include <iostream>

int main( )
{
   using namespace std;

   list<int> L;
   front_insert_iterator<list<int> > fiivIter( L );
   *fiivIter = 10;
   *fiivIter = 20;
   *fiivIter = 30;
   
   list<int>::iterator LIter;
   cout << "The list L is: ( ";
   for ( LIter = L.begin ( ) ; LIter != L.end ( ); LIter++)
      cout << *LIter << " ";
   cout << ")." << endl;

   front_insert_iterator<list<int> >::reference 
        RefFirst = *(L.begin ( ));
   cout << "The first element in the list L is: " 
        << RefFirst << "." << endl;
}
  
  

需求

標題: <iterator>

命名空間: std

請參閱

參考

front_insert_iterator Class

標準樣板程式庫