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

履歴 編集

function
<forward_list>

std::forward_list::pop_front(C++11)

void pop_front();

概要

先頭要素を削除する

要件

empty() == falseであること。

戻り値

なし

例外

投げない

#include <iostream>
#include <forward_list>
#include <algorithm>

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

  ls.pop_front();

  std::for_each(ls.begin(), ls.end(), [](int x) {
    std::cout << x << std::endl;
  });
}

出力

2
3

バージョン

言語

  • C++11

処理系

参照