std::ranges::chunk_view<V>::inner-iterator
From cppreference.com
< cpp | ranges | chunk view
| class /*inner-iterator*/ |
(C++23から) (説明用*) |
|
V が input_range をモデルとする場合、chunk_view::outer-iterator::value_type::begin の戻り値の型。
目次 |
[edit] メンバ型
| メンバ型 | 定義 |
iterator_concept
|
std::input_iterator_tag |
difference_type
|
ranges::range_difference_t<V> |
value_type
|
ranges::range_value_t<V> |
[edit] データメンバ
| メンバオブジェクト | 定義 |
parent_ (private) |
型 ranges::chunk_view* の「親オブジェクト」へのポインタ。 (説明用のメンバオブジェクト*) |
[edit] メンバ関数
| (C++23) |
イテレータを構築する (public member function) |
| (C++23) |
別のイテレータをムーブ代入する (public member function) |
| (C++23) |
現在の要素へのイテレータを返す (public member function) |
| (C++23) |
要素にアクセスします (public member function) |
| (C++23) |
イテレータを進める (public member function) |
[edit] 非メンバ関数
| (C++23) |
イテレータと default sentinel を比較する (関数) |
| (C++23) |
残りの要素数を計算する (関数) |
| (C++23) |
基底イテレータの間接参照の結果を関連する右辺値参照型にキャストする (関数) |
| (C++23) |
2つの基底イテレータが指すオブジェクトをスワップする (関数) |
[edit] 例
このコードを実行
#include <iostream> #include <iterator> #include <ranges> #include <sstream> int main() { auto letters = std::istringstream{"ABCDEFGHIJK"}; auto chunks = std::ranges::istream_view<char>(letters) | std::views::chunk(4); for (auto chunk : chunks) { // chunk is an object of type chunk_view::outer_iterator::value_type std::cout << '['; for (auto inner_iter = chunk.begin(); inner_iter != std::default_sentinel; ++inner_iter) std::cout << *inner_iter; std::cout << "] "; } std::cout << '\n'; }
出力
[ABCD] [EFGH] [IJK]
[edit] 参考文献
- C++23標準 (ISO/IEC 14882:2024)
- 26.7.28.5 Class chunk_view::inner-iterator [range.chunk.inner.iter]