最終更新日時(UTC):
が更新

履歴 編集

function
<deque>

std::deque::pop_front

void pop_front();

概要

先頭要素を削除する。

戻り値

なし

例外

投げない

計算量

定数時間

#include <iostream>
#include <deque>

int main()
{
  std::deque<int> c = {1, 2, 3};

  c.pop_front();

  for (int x : c) {
    std::cout << x << std::endl;
  }
}

出力

2
3

関連項目

名前 説明
pop_back 末尾要素を削除する
push_front 先頭に要素を追加する
erase 指定した要素を削除する