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

履歴 編集

function
<forward_list>

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

reference front();
const_reference front() const;

概要

先頭要素への参照を取得する。

戻り値

*begin()

計算量

定数時間

#include <iostream>
#include <forward_list>

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

  int& x = ls.front();
  std::cout << x << std::endl;
}

出力

3

バージョン

言語

  • C++11

処理系

参照