deque::reference
提供对元素的引用类型。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;
}
要求
标头: <deque>
命名空间: std