valid type */  
class  transform_view  
:  public  [ ranges::  view_interface  ](http://en.cppreference.com/w/cpp/ranges/view_interface) < transform_view  < V, F  >> |  |  (since C++23)   
namespace  views  {  
inline  constexpr  /*unspecified*/  transform  =  /*unspecified*/  ;  
}  |  (2)  |  (since C++20)   
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  transform  (  R  && r, F  && fun  )  ;  |  |  (since C++20)   
template  < class  F  >  
constexpr  /*range adaptor closure*/  transform  (  F  && fun  )  ;  |  |  (since C++20)   
|  |   
  
1)  A range adaptor that represents [ ` view ` ](/w/cpp/ranges/view
"cpp/ranges/view") of an underlying sequence after applying a transformation
function to each element.

2)  [ RangeAdaptorObject  ](/w/cpp/named_req/RangeAdaptorObject "cpp/named
req/RangeAdaptorObject") . The expression  views  ::  transform  (  e, f  )
is [ expression-equivalent ](/w/cpp/language/expressions#Expression-
equivalence "cpp/language/expressions") to  transform_view  (  e, f  )  for
any suitable subexpressions  e  and  f  .

` transform_view ` models the concepts [ ` random_access_range `
](/w/cpp/ranges/random_access_range "cpp/ranges/random access range") , [ `
bidirectional_range ` ](/w/cpp/ranges/bidirectional_range
"cpp/ranges/bidirectional range") , [ ` forward_range `
](/w/cpp/ranges/forward_range "cpp/ranges/forward range") , [ ` input_range `
](/w/cpp/ranges/input_range "cpp/ranges/input range") , [ ` common_range `
](/w/cpp/ranges/common_range "cpp/ranges/common range") , and [ ` sized_range
` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") when the underlying
view ` V ` models respective concepts.

##  Contents

  * 1  Member functions 
    * 1.1  Inherited from  std::ranges::view_interface 
  * 2  Deduction guides 
  * 3  Nested classes 
  * 4  Example 
  * 5  See also 

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

[ (constructor)  ](/w/cpp/ranges/transform_view/transform_view "cpp/ranges/transform view/transform view") (C++20)  |  constructs a ` transform_view `   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_constructor&action=edit)  
---|---  
[ base  ](/w/cpp/ranges/transform_view/base "cpp/ranges/transform view/base") (C++20)  |  returns a copy of the underlying (adapted) view   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_base&action=edit)  
[ begin  ](/w/cpp/ranges/transform_view/begin "cpp/ranges/transform view/begin") (C++20)  |  returns an iterator to the beginning   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_begin&action=edit)  
[ end  ](/w/cpp/ranges/transform_view/end "cpp/ranges/transform view/end") (C++20)  |  returns an iterator or a sentinel to the end   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_end&action=edit)  
[ size  ](/w/cpp/ranges/transform_view/size "cpp/ranges/transform view/size") (C++20)  |  returns the number of elements. Provided only if the underlying (adapted) range satisfies [ ` sized_range ` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") .   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_size&action=edit)  
  
#####  Inherited from  [ std::ranges::view_interface
](/w/cpp/ranges/view_interface "cpp/ranges/view interface")  
  
[ empty  ](/w/cpp/ranges/view_interface/empty "cpp/ranges/view interface/empty") (C++20)  |  returns whether the derived view is empty. Provided if