cpp/ranges/chunk by view

{{dcl|num=2|since=c++23|1= namespace views { inline constexpr /* unspecified */ chunk_by = /* unspecified */ ; }}

@1@ is a range adaptor that takes a  and an invocable object  (the binary predicate), and produces a  of subranges (chunks), by splitting the underlying view between each pair of adjacent elements for which  returns. The first element of each such pair belongs to the previous chunk, and the second element belongs to the next chunk.

@2@ The name denotes a. Given a subexpression and, the expression  is expression-equivalent to.

always models, and models and/or , if adapted  type models the corresponding concepts. never models or.

Data members
Typical implementations of hold three non-static data members:
 * the underlying of type  (shown here as  for exposition only),
 * a wrapper that wraps the predicate used to split the elements of of type  (shown here as  for exposition only), where  is a wrapper class template that always satisfies ,
 * an object of std-like type (shown here as for exposition only) that caches an iterator to the first element.