constexpr auto end()
requires (!simple-view<Views> || ...); // (1) C++26
constexpr auto end() const
requires (range<const Views> && ...); // (2) C++26
概要
番兵を取得する。
戻り値
- (1), (2) :
concat_view
の番兵を返す
例
#include <print>
#include <ranges>
#include <array>
#include <vector>
int main() {
std::vector<int> v1{1, 2, 3};
std::vector<int> v2{4, 5};
std::array<int, 3> a{6, 7, 8};
std::ranges::concat_view r{v1, v2, a};
auto it = r.begin();
auto end_it = r.end();
while (it != end_it) {
std::print("{} ", *it);
++it;
}
std::println();
}
出力
1 2 3 4 5 6 7 8
バージョン
言語
- C++26
処理系
- Clang: 20 ❌
- GCC: 15 ✅
- Visual C++: 2022 Update 14 ❌