다음을 통해 공유


front_insert_iterator::reference

A type that provides a reference to an element in a sequence controlled by the associated container.

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 클래스

표준 템플릿 라이브러리