Freigeben über


list::reference

Ein Typ, der einen Verweis auf ein Element bereitstellt, gespeicherten in einer Liste.

typedef typename Allocator::reference reference;

Beispiel

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

int main( ) 
{
   using namespace std;
   list <int> c1;
   
   c1.push_back( 10 );
   c1.push_back( 20 );

   int &i = c1.front( );
   int &j = c1.back( );
   cout << "The first element is " << i << endl;
   cout << "The second element is " << j << endl;
}
  

Anforderungen

Header: <list>

Namespace: std

Siehe auch

Referenz

list Class

Standardvorlagenbibliothek