iterator end() noexcept;
const_iterator end() const noexcept;
概要
コンテナの末尾の次を参照するイテレータを取得する。
戻り値
コンテナの最後の要素の次を参照するイテレータ。
iterator
と const_iterator
はいずれもメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。
計算量
定数時間。
備考
- この関数によって返されるイテレータは、
*this
が保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう
例
#include <flat_set>
#include <iostream>
int main()
{
std::flat_multiset<int> fs = {3, 1, 4, 1};
for (auto i = fs.begin(); i != fs.end(); ++i) {
std::cout << *i << std::endl;
}
}
12
#include <flat_set>
#include <iostream>
int main()
{
std::flat_multiset<int> fs = {3, 1, 4, 1};
for (auto i = fs.begin(); i != fs.end(); ++i) {
std::cout << *i << std::endl;
}
}
出力
1
1
3
4
バージョン
言語
- C++23
処理系
- Clang: ??
- GCC: ??
- Visual C++: ??
関連項目
名前 | 説明 |
---|---|
flat_multiset::begin |
先頭を指すイテレータを取得する |
flat_multiset::cbegin |
先頭を指すconstイテレータを取得する |
flat_multiset::cend |
末尾の次を指すconstイテレータを取得する |
flat_multiset::rbegin |
末尾の次を指す逆イテレータを取得する |
flat_multiset::rend |
先頭の前を指す逆イテレータを取得する |
flat_multiset::crbegin |
末尾を指す逆constイテレータを取得する |
flat_multiset::crend |
先頭の前を指す逆constイテレータを取得する |