- list[meta header]
- std[meta namespace]
- list[meta class]
- function[meta id-type]
- cpp11[meta cpp]
const_iterator cend() const noexcept;末尾の次を指す読み取り専用イテレータを取得する。
末尾の次を指す読み取り専用イテレータ
投げない
- この関数によって返されるイテレータは、
*thisが保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう
#include <iostream>
#include <list>
#include <algorithm>
int main()
{
std::list<int> ls = { 1, 2, 3 };
// このアルゴリズム内ではlsの書き換えを決して行わない
std::for_each(ls.cbegin(), ls.cend(), [](const int& x) {
std::cout << x << std::endl;
});
}- cend()[color ff0000]
- ls.cbegin()[link cbegin.md]
1
2
3
- C++11
- Clang: ??
- GCC: 4.7.0
- ICC: ??
- Visual C++: 2010