deque::pop_front

在、向量、双端队列的开头删除元素。

void pop_front( );

备注

第一个元素不能为空。 pop_front 永远不会引发异常。

示例

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

int main( ) 
{
   using namespace std;
   deque <int> c1;
   
   c1.push_back( 1 );
   c1.push_back( 2 );
   cout << "The first element is: " << c1.front( ) << endl;
   cout << "The second element is: " << c1.back( ) << endl;

   c1.pop_front( );
   cout << "After deleting the element at the beginning of the "
      "deque, the first element is: " << c1.front( ) << endl;
}
  

要求

标头: <deque>

命名空间: std

请参见

参考

deque Class

deque::push_front 和 deque::pop_front

标准模板库