cpp/ranges/chunk by view/helpers

{{member|{{small|std::ranges::chunk_by_view::}}next|2= {{ddcl|since=c++23|1= constexpr ranges::iterator_t /*find-next*/( ranges::iterator_t current );   // exposition only }}

Finds the next chunk.

Let {{rlpi|/#Data members|base_}} and {{rlpi|/#Data members|pred_}} be the appropriate underlying (exposition-only) data-members of {{rlpt|/|chunk_by_view}}.

Equivalent to {{source|1= return ranges::next (       ranges::adjacent_find        ( current, ranges::end(base_), std::not_fn(std::ref(*pred_)) ),       1, ranges::end(base_)    ); }}

The behavior is undefined if {{c|pred_.has_value}} is {{c|false}} before the call to this function.

Used in the following non-static member functions:
 * {{lc|ranges::chunk_by_view}}{{rlpt|iterator/operator_arith|::iterator::operator++}}

Parameters
}}

{{member|{{small|std::ranges::chunk_by_view::}}prev|2= {{ddcl|since=c++23|1= constexpr iterator_t /*find-prev*/( ranges::iterator_t current )   // exposition only requires ranges::bidirectional_range; }}

Finds the previous chunk.

Let {{rlpi|/#Data members|base_}} and {{rlpi|/#Data members|pred_}} be the appropriate underlying (exposition-only) data-members of {{rlpt|/|chunk_by_view}}.

Returns an iterator {{tt|i}} in the range {{range|ranges::begin(base_)|current}} such that:
 * {{c|ranges::adjacent_find(i, current, std::not_fn(std::ref(*pred_)))}} is equal to {{c|current}}, and
 * if {{tt|i}} is not equal to {{c|ranges::begin(base_)}}, then {{c|bool(std::invoke(*pred_, *ranges::prev(i), *i))}} is {{c|false}}.

The behavior is undefined if before the call to this function {{c|1=current == ranges::begin(base_)}} or {{c|1=pred_.has_value != true}}.

Used in the following non-static member functions:
 * {{lc|ranges::chunk_by_view}}{{rlpt|iterator/operator_arith|::iterator::operator--}}

Parameters
}}