namespace std::ranges {
template<class T, class Bound = unreachable_sentinel_t>
repeat_view(T, Bound = Bound()) -> repeat_view<T, Bound>;
}
概要
repeat_view
クラステンプレートの型推論補助。
例
#include <iostream>
#include <ranges>
int main() {
auto r = std::ranges::repeat_view(42, 3);
for (int x : r) {
std::cout << x << std::endl;
}
}
出力
42
42
42
バージョン
言語
- C++23
処理系
- Clang: 17 ✅
- GCC: 13 ✅
- ICC: ?
- Visual C++: 2022 Update 6 ✅