Export (0) Print
Expand All

deque::reference

A type that provides a reference to an element stored in a deque.

typedef typename Allocator::reference reference;

// deque_reference.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

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

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

Header: <deque>

Namespace: std

Show:
© 2015 Microsoft