共用方式為


deque::reference

提供的項目參考的型別在雙向佇列儲存。

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

請參閱

參考

deque 類別

標準樣板程式庫