std::ranges::chunk_by_view<V,Pred>::find_next, std::ranges::chunk_by_view<V,Pred>::find_prev

From cppreference.com
 
 
Ranges library
Range access
Range conversions
(C++23)
Range primitives



Dangling iterator handling
Range concepts
Views

Range factories
Range adaptors
Range generators
Range adaptor objects
Range adaptor closure objects
Helper items
(until C++23)(C++23)


 
 

std::ranges::chunk_by_view::next

constexpr ranges::iterator_t<V>
    /*find-next*/( ranges::iterator_t<V> current );    // exposition only
(since C++23)

Finds the next chunk.

Let base_ and pred_ be the appropriate underlying (exposition-only) data-members of chunk_by_view.

Equivalent to

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 pred_.has_value() is false before the call to this function.


Used in the following non-static member functions:

Parameters

current - the iterator to current element in adapted view

std::ranges::chunk_by_view::prev

constexpr iterator_t<V>

    /*find-prev*/( ranges::iterator_t<V> current )    // exposition only

        requires ranges::bidirectional_range<V>;
(since C++23)

Finds the previous chunk.

Let base_ and pred_ be the appropriate underlying (exposition-only) data-members of chunk_by_view.

Returns an iterator i in the range [ranges::begin(base_)current) such that:


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


Used in the following non-static member functions:

Parameters

current - the iterator to current element in adapted view