std::ranges::chunk_view<V>::inner-iterator
ja.cppreference.net から
class /*inner-iterator*/
|
(C++23 から) (説明のみ*) |
|
の戻り値の型 chunk_view::outer-iterator::value_type::begin もし V が input_range をモデル化する場合。
メンバ型
| メンバ | 定義 |
iterator_concept
|
std::input_iterator_tag
|
difference_type
|
ranges::range_difference_t<V>
|
value_type
|
ranges::range_value_t<V>
|
データメンバ
| メンバ | 説明 |
ranges::chunk_view* parent_ (非公開)
|
親オブジェクトへのポインタ (説明専用メンバオブジェクト*) |
メンバー関数
|
(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) |
非メンバー関数
|
(C++23)
|
イテレータを
default sentinel
と比較する
(関数) |
|
(C++23)
|
残りの要素数を計算する
(関数) |
|
(C++23)
|
基盤となるイテレータのデリファレンス結果を、関連する右辺値参照型にキャストする
(関数) |
|
(C++23)
|
2つの基盤となるイテレータが指すオブジェクトを交換する
(関数) |
例
このコードを実行
#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は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]
参考文献
- C++23標準 (ISO/IEC 14882:2024):
-
- 26.7.28.5 クラス chunk_view:: inner-iterator [range.chunk.inner.iter]