zation of  [ ranges::  subrange  ](http://en.cppreference.com/w/cpp/ranges/subrange) ; 

  * [ ranges::  iota_view  ](http://en.cppreference.com/w/cpp/ranges/iota_view) (  *  [ ranges::  begin  ](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/begin) (  e  )  ,    
*  (  [ ranges::  begin  ](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/begin) (  e  )  \+  [ std::  min  ](http://en.cppreference.com/w/cpp/algorithm/min) < D  > (  [ ranges::  distance  ](http://en.cppreference.com/w/cpp/iterator/ranges/distance) (  e  )  , f  )  )  )  , if ` T ` is a specialization of  [ ranges::  iota_view  ](http://en.cppreference.com/w/cpp/ranges/iota_view) that models both [ ` random_access_range ` ](/w/cpp/ranges/random_access_range "cpp/ranges/random access range") and [ ` sized_range ` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") ; 

  * otherwise, if ` T ` is a specialization of [ ` ranges::repeat_view ` ](/w/cpp/ranges/repeat_view "cpp/ranges/repeat view") : 

    

  * [ views::  repeat  ](http://en.cppreference.com/w/cpp/ranges/repeat_view) (  *  e.  value_  , [ std::  min  ](http://en.cppreference.com/w/cpp/algorithm/min) < D  > (  [ ranges::  distance  ](http://en.cppreference.com/w/cpp/iterator/ranges/distance) (  e  )  , f  )  )  , if ` T ` models [ ` sized_range ` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") ; is such case  e  is evaluated only once; 
  * [ views::  repeat  ](http://en.cppreference.com/w/cpp/ranges/repeat_view) (  *  e.  value_  ,  static_cast  < D  > (  e  )  )  otherwise; 

|  (since C++23)  
---|---  
  
  * otherwise,  take_view  (  e, f  )  . 

In all cases,  decltype  (  (  f  )  )  must model  [ std::  convertible_to
](http://en.cppreference.com/w/cpp/concepts/convertible_to) < D  > .

` take_view ` models the concepts [ ` contiguous_range `
](/w/cpp/ranges/contiguous_range "cpp/ranges/contiguous range") , [ `
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") , and [ ` sized_range `
](/w/cpp/ranges/sized_range "cpp/ranges/sized range") when the underlying view
V  models respective concepts. It models [ ` common_range `
](/w/cpp/ranges/common_range "cpp/ranges/common range") when the underlying
view  V  models both [ ` random_access_range `
](/w/cpp/ranges/random_access_range "cpp/ranges/random access range") and [ `
sized_range ` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") .

##  Contents

  * 1  Member functions 
    * 1.1  Inherited from  std::ranges::view_interface 
  * 2  Deduction guides 
  * 3  Nested classes 
  * 4  Helper templates 
  * 5  Example 
  * 6  Defect reports 
  * 7  See also 

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

[ (constructor)  ](/w/cpp/ranges/take_view/take_view "cpp/ranges/take view/take view") (C++20)  |  constructs a ` take_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/take_view/base "cpp/ranges/take 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/take_view/begin "cpp/ranges/take 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/take_view/end "cpp/ranges/take view/end") (C++20)  |  returns an iterator or a sentinel to the end