w/cpp/ranges/chunk_by_view/deduction_guides
"cpp/ranges/chunk by view/deduction guides")  
[ Iterator ](/w/cpp/ranges/chunk_by_view/iterator "cpp/ranges/chunk by
view/iterator")  
[ chunk_by_view:: _iterator_ :: _iterator_
](/w/cpp/ranges/chunk_by_view/iterator/iterator "cpp/ranges/chunk by
view/iterator/iterator")  
[ chunk_by_view:: _iterator_ ::operator*
](/w/cpp/ranges/chunk_by_view/iterator/operator* "cpp/ranges/chunk by
view/iterator/operator*")  
[ chunk_by_view:: _iterator_ ::operator++  
chunk_by_view:: _iterator_ ::operator++  (int)  
chunk_by_view:: _iterator_ ::operator--  
chunk_by_view:: _iterator_ ::operator--  (int)
](/w/cpp/ranges/chunk_by_view/iterator/operator_arith "cpp/ranges/chunk by
view/iterator/operator arith")  
[ operator==  (chunk_by_view:: _iterator_ )
](/w/cpp/ranges/chunk_by_view/iterator/operator_cmp "cpp/ranges/chunk by
view/iterator/operator cmp")  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/chunk_by_view/navbar_content&action=edit)

Defined in header ` [ <ranges> ](/w/cpp/header/ranges "cpp/header/ranges") ` |  |   
---|---|---  
template  < [ ranges::  forward_range
](http://en.cppreference.com/w/cpp/ranges/forward_range) V, [ std::
indirect_binary_predicate
](http://en.cppreference.com/w/cpp/iterator/indirect_binary_predicate) <
iterator_t  < V  > ,  
[ ranges::  iterator_t  ](http://en.cppreference.com/w/cpp/ranges-ranges-
placeholder/iterator_t) < V  >> Pred  >  
requires [ ranges::  view  ](http://en.cppreference.com/w/cpp/ranges/view) < V
> && [ std::  is_object_v  ](http://en.cppreference.com/w/cpp/types/is_object)
< Pred  >  
class  chunk_by_view  
:  public  [ ranges::  view_interface  ](http://en.cppreference.com/w/cpp/ranges/view_interface) < chunk_by_view  < V, Pred  >> |  (1)  |  (since C++23)   
namespace  views  {  
inline  constexpr  /* unspecified */  chunk_by  =  /* unspecified */  ;  
}  |  (2)  |  (since C++23)   
Call signature  |  |   
template  < [ ranges::  viewable_range
](http://en.cppreference.com/w/cpp/ranges/viewable_range) R,  class  Pred  >  
requires  /* see below */  
constexpr  [ ranges::  view  ](http://en.cppreference.com/w/cpp/ranges/view) auto  chunk_by  (  R  && r, Pred  && pred  )  ;  |  |  (since C++23)   
template  < class  Pred  >  
constexpr  /*range adaptor closure*/  chunk_by  (  Pred  && pred  )  ;  |  |  (since C++23)   
|  |   
  
1)  ` chunk_by_view ` is a range adaptor that takes a [ ` view `
](/w/cpp/ranges/view "cpp/ranges/view") and an invocable object  pred  (the
binary predicate), and produces a [ ` view ` ](/w/cpp/ranges/view
"cpp/ranges/view") of subranges (chunks), by splitting the underlying view
between each pair of adjacent elements for which  pred  returns  false  . The
first element of each such pair belongs to the previous chunk, and the second
element belongs to the next chunk.

2)  The name  views  ::  chunk_by  denotes a [ RangeAdaptorObject
](/w/cpp/named_req/RangeAdaptorObject "cpp/named req/RangeAdaptorObject") .
Given a subexpression  e  and  f  , the expression  views  ::  chunk_by  (  e,
f  )  is [ expression-equivalent ](/w/cpp/language/expressions#Expression-
equivalence "cpp/language/expressions") to  chunk_by_view  (  e, f  )  .

` chunk_by_view ` always models [ ` forward_range `
](/w/cpp/ranges/forward_range "cpp/ranges/forward range") , and models [ `
bidirectional_range ` ](/w/cpp/ranges/bidirectional_range
"cpp/ranges/bidirectional range") and/or [ ` common_range `
](/w/cpp/ranges/common_range "cpp/ranges/common range") , if adapted [ ` view
` ](/w/cpp/ranges/view "cpp/ranges/view") type models the corresponding
concepts. ` chunk_by_view ` never models [ ` borrowed_range `
](/w/cpp/ranges/borrowed_range "cpp/ranges/borrowed range") or [ ` sized_range
` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") .

##  Contents

  * 1  Data members 
  * 2  Member functions 
    * 2.1  Inherited from  std::ranges::view_interface 
  * 3  Deduction guides 
  * 4  Nested classes