deque::reference

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

typedef typename Allocator::reference reference;

Example

// 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

Requirements

Header: <deque>

Namespace: std

See Also

Reference

deque Class

Standard Template Library