- forward_list[meta header]
- std[meta namespace]
- forward_list[meta class]
- function[meta id-type]
- cpp11[meta cpp]
reference front();
const_reference front() const;先頭要素への参照を取得する。
定数時間
#include <iostream>
#include <forward_list>
int main()
{
std::forward_list<int> ls = {3, 1, 4};
int& x = ls.front();
std::cout << x << std::endl;
}- front()[color ff0000]
3
- C++11
- Clang: ??
- GCC: 4.7.0
- ICC: ??
- Visual C++: ??