xpr  auto  pairwise_transform  =  adjacent_transform  < 2  > ;  
}  |  (3)  |  (since C++23)   
Call signature  |  |   
template  < [ ranges::  viewable_range
](http://en.cppreference.com/w/cpp/ranges/viewable_range) R,  class  F  >  
requires  /* see below */  
constexpr  [ ranges::  view  ](http://en.cppreference.com/w/cpp/ranges/view) auto  adjacent_transform  < N  > (  R  && r, F  && fun  )  ;  |  |  (since C++23)   
template  < class  F  >  
constexpr  /*range adaptor closure*/  adjacent_transform  < N  > (  F  && fun  )  ;  |  |  (since C++23)   
|  |   
  
1)  ` adjacent_transform_view ` is a range adaptor that takes a [ ` view `
](/w/cpp/ranges/view "cpp/ranges/view") and an invocable object  fun  , and
produces a [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") whose ` _i_ ` th
element is a value that is the result of applying  fun  to each element in ` [
` i  ` , ` i  \+  N  ` ) ` of the original view. ` F ` always has [ arity
](https://en.wikipedia.org/wiki/arity "enwiki:arity") ` N ` .

Let ` _S_ ` be the size of the original view. Then the size of produced view
is:

  * S  \-  N  \+  1  , if  S  >=  N  , 
  * ​  0  ​  otherwise, and the resulting view is empty. 

2)  The name  views  ::  adjacent_transform  < N  > denotes a [
RangeAdaptorObject  ](/w/cpp/named_req/RangeAdaptorObject "cpp/named
req/RangeAdaptorObject") . Given subexpressions  e  and  f  , and a constant
expression ` N ` , the expression  views  ::  adjacent_transform  < N  > (  e,
f  )  is [ expression-equivalent ](/w/cpp/language/expressions#Expression-
equivalence "cpp/language/expressions") to:

  * (  (  void  )  e, [ views::  zip_transform  ](http://en.cppreference.com/w/cpp/ranges/zip_transform_view) (  f  )  )  , if ` N ` is equal to  ​  0  ​  (except that the evaluations of  e  and  f  are [ indeterminately sequenced ](/w/cpp/language/eval_order#Ordering "cpp/language/eval order") ), 
  * adjacent_transform_view  < [ views::  all_t  ](http://en.cppreference.com/w/cpp/ranges/all_view) < decltype  (  (  e  )  )  > , [ std::  decay_t  ](http://en.cppreference.com/w/cpp/types/decay) < decltype  (  (  f  )  )  > , N  > (  e, f  )  otherwise. 

3)  The name  views  ::  pairwise_transform  denotes a [ RangeAdaptorObject
](/w/cpp/named_req/RangeAdaptorObject "cpp/named req/RangeAdaptorObject") that
behaves exactly as  views  ::  adjacent_transform  < 2  > . In particular, the
arity of ` F ` is also  2  and  fun  is a binary invocable object.

` adjacent_transform_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") , [ ` random_access_range `
](/w/cpp/ranges/random_access_range "cpp/ranges/random access range") , or [ `
sized_range ` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") , if
adapted [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") type models the
corresponding concept.

##  Contents

  * 1  Member functions 
    * 1.1  Inherited from  std::ranges::view_interface 
  * 2  Deduction guides 
  * 3  Member types 
  * 4  Data members 
  * 5  Nested classes 
  * 6  Notes 
  * 7  Example 
  * 8  References 
  * 9  See also 

  
---  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/adjacent_transform_view&action=edit&section=1
"Edit section: Member functions") ]  Member functions

[ (constructor)  ](/w/cpp/ranges/adjacent_transform_view/adjacent_transform_view "cpp/ranges/adjacent transform view/adjacent transform view") (C++23)  |  constructs a ` adjacent_transform_view `   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_constructor&action=edit)  
---|---  
[ begin  ](/w/cpp/ranges/adjacent_transform_view/begin "cpp/ranges/adjacent transform view/begin") (C++23)  |  returns an iterator to the beginning   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/rang