ence.com/w/cpp/utility/tuple_size) < T  > ::  type  ;  
requires N  < [ std::  tuple_size_v
](http://en.cppreference.com/w/cpp/utility/tuple_size) < T  > ;  
typename  [ std::  tuple_element_t
](http://en.cppreference.com/w/cpp/utility/tuple_element) < N, T  > ;  
{  [ std::  get  ](http://en.cppreference.com/w/cpp/utility/variant/get) < N
> (  t  )  }  \-  > [ std::  convertible_to
](http://en.cppreference.com/w/cpp/concepts/convertible_to) <  
const  [ std::  tuple_element_t
](http://en.cppreference.com/w/cpp/utility/tuple_element) < N, T  > & > ;  
}  ;  |  |  (until C++23)    
(  exposition only*  )  
template  < class  T, [ std::  size_t
](http://en.cppreference.com/w/cpp/types/size_t) N  >  
concept has  \-  tuple  \-  element  =  
tuple  \-  like  < T  > && N  < [ std::  tuple_size_v  ](http://en.cppreference.com/w/cpp/utility/tuple_size) < T  > |  |  (since C++23)    
(  exposition only*  )  
template  < class  T, [ std::  size_t
](http://en.cppreference.com/w/cpp/types/size_t) N  >  
concept returnable  \-  element  =  
[ std::  is_reference_v
](http://en.cppreference.com/w/cpp/types/is_reference) < T  > ||  [ std::
move_constructible
](http://en.cppreference.com/w/cpp/concepts/move_constructible) <  
[ std::  tuple_element_t  ](http://en.cppreference.com/w/cpp/utility/tuple_element) < N, T  >> ;  |  (4)  |  (  exposition only*  )   
|  |   
  
1)  Accepts a [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") of tuple-like
values, and issues a view with a value type of the ` N ` -th element of the
adapted view's value-type.

2)  Every specialization of ` views::elements ` is a [ RangeAdaptorObject
](/w/cpp/named_req/RangeAdaptorObject "cpp/named req/RangeAdaptorObject") .
The expression  views  ::  elements  < M  > (  e  )  is [ expression-
equivalent ](/w/cpp/language/expressions#Expression-equivalence
"cpp/language/expressions") to  elements_view  < [ views::  all_t
](http://en.cppreference.com/w/cpp/ranges/all_view) < decltype  (  (  e  )  )
> , M  > {  e  }  for any suitable subexpression  e  and constant expression
M  .

3)  Ensures that the elements of the underlying view are tuple-like values  ,
see [ ` _tuple-like_ ` ](/w/cpp/utility/tuple/tuple-like
"cpp/utility/tuple/tuple-like") (since C++23)  .

4)  Ensures that dangling references cannot be returned.

` elements_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  Nested classes 
  * 3  Helper templates 
  * 4  Example 
  * 5  Defect reports 
  * 6  See also 

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

[ (constructor)  ](/w/cpp/ranges/elements_view/elements_view "cpp/ranges/elements view/elements view") (C++20)  |  constructs a ` elements_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/elements_view/base "cpp/ranges/elements 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/elements_view/begin "cpp/ranges/elements view/begin") (C++20)  |  returns an iterator to the beginning   
(public member func