다음을 통해 공유


deque::pop_front

Deletes the element at the beginning of the deque.

void pop_front( );

설명

첫 번째 요소는 비워둘 수 없습니다. pop_front 는 예외를 다시 throw할 수 없습니다.

예제

// 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 클래스

deque::push_front 및 deque::pop_front

표준 템플릿 라이브러리