iterator end() noexcept; // (1) C++26
const_iterator end() const noexcept; // (2) C++26
概要
末尾の次を指すイテレータを取得する。
このイテレータは、有効な要素を指さない終端を表す番兵として使用する。
戻り値
末尾の次を指すイテレータ
例外
投げない
計算量
定数時間
例
#include <hive>
#include <print>
int main()
{
std::hive<int> h;
h.insert(1);
h.insert(2);
h.insert(3);
// begin()からend()まで走査する
for (auto it = h.begin(); it != h.end(); ++it) {
std::print("{} ", *it);
}
std::println("");
}
出力例
1 2 3
バージョン
言語
- C++26
処理系
- Clang: 22 ❌
- GCC: 16.1 ❌
- Visual C++: 2026 Update 2 ❌