nst") (C++17)  
  
Common vocabulary types  
|  [ pair  ](/w/cpp/utility/pair "cpp/utility/pair")  
---  
[ tuple  ](/w/cpp/utility/tuple "cpp/utility/tuple") (C++11)  
[ optional  ](/w/cpp/utility/optional "cpp/utility/optional") (C++17)  
[ any  ](/w/cpp/utility/any "cpp/utility/any") (C++17)  
[ variant  ](/w/cpp/utility/variant "cpp/utility/variant") (C++17)  
  
|  [ tuple_size  ](/w/cpp/utility/tuple_size "cpp/utility/tuple size") (C++11)  
---  
** tuple_element  ** (C++11)  
[ apply  ](/w/cpp/utility/apply "cpp/utility/apply") (C++17)  
[ make_from_tuple  ](/w/cpp/utility/make_from_tuple "cpp/utility/make from
tuple") (C++17)  
[ expected  ](/w/cpp/utility/expected "cpp/utility/expected") (C++23)  
  
[ Elementary string conversions ](/w/cpp/utility#Elementary_string_conversions
"cpp/utility")  
|  [ to_chars  ](/w/cpp/utility/to_chars "cpp/utility/to chars") (C++17)  
---  
[ from_chars  ](/w/cpp/utility/from_chars "cpp/utility/from chars") (C++17)  
[ chars_format  ](/w/cpp/utility/chars_format "cpp/utility/chars format")
(C++17)  
  
|  [ to_chars_result  ](/w/cpp/utility/to_chars_result "cpp/utility/to chars
result") (C++17)  
---  
[ from_chars_result  ](/w/cpp/utility/from_chars_result "cpp/utility/from
chars result") (C++17)  
  
  
  
  
  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/navbar_content&action=edit)

Defined in header ` [ <tuple> ](/w/cpp/header/tuple "cpp/header/tuple") ` |  |   
---|---|---  
Defined in header ` [ <array> ](/w/cpp/header/array "cpp/header/array") ` |  |   
Defined in header ` [ <utility> ](/w/cpp/header/utility "cpp/header/utility") ` |  |   
Defined in header ` [ <ranges> ](/w/cpp/header/ranges "cpp/header/ranges") ` |  |  (since C++20)   
template  < [ std::  size_t  ](http://en.cppreference.com/w/cpp/types/size_t)
I,  class  T  >  
struct  tuple_element  ;  // not defined  |  (1)  |  (since C++11)   
template  < [ std::  size_t  ](http://en.cppreference.com/w/cpp/types/size_t)
I,  class  T  >  
struct  tuple_element  < I,  const  T  > {  
using  type  =  typename  
[ std::  add_const  ](http://en.cppreference.com/w/cpp/types/add_cv) <
typename  std  ::  tuple_element  < I, T  > ::  type  > ::  type  ;  
}  ;  |  (2)  |  (since C++11)   
template  < [ std::  size_t  ](http://en.cppreference.com/w/cpp/types/size_t)
I,  class  T  >  
struct  tuple_element  < I,  volatile  T  > {  
using  type  =  typename  
[ std::  add_volatile  ](http://en.cppreference.com/w/cpp/types/add_cv) <
typename  std  ::  tuple_element  < I, T  > ::  type  > ::  type  ;  
}  ;  |  (3)  |  (since C++11)    
(deprecated in C++20)  
template  < [ std::  size_t  ](http://en.cppreference.com/w/cpp/types/size_t)
I,  class  T  >  
struct  tuple_element  < I,  const  volatile  T  > {  
using  type  =  typename  
[ std::  add_cv  ](http://en.cppreference.com/w/cpp/types/add_cv) < typename
std  ::  tuple_element  < I, T  > ::  type  > ::  type  ;  
}  ;  |  (4)  |  (since C++11)    
(deprecated in C++20)  
|  |   
  
Provides compile-time indexed access to the types of the elements of a [
tuple-like ](/w/cpp/utility/tuple/tuple-like "cpp/utility/tuple/tuple-like")
type.

1)  The primary template is not defined. An explicit (full) or partial
specialization is required to make a type tuple-like.

2-4)  Specializations for cv-qualified types simply add corresponding cv-
qualifiers by default.

` std::tuple_element ` interacts with the core language: it can provide [ structured binding ](/w/cpp/language/structured_binding "cpp/language/structured binding") support in the tuple-like case.  |  (since C++17)   
---|---  
  
##  Contents

  * 1  Specializations 
  * 2  Member types 
  * 3  Helper types 
  * 4  Notes 
  * 5  Example 
  * 6  Defect reports 
  * 7  See also 

  
---  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/utility/tuple_element&action=edit&section=1 "Edit
section: Specializations") ]  Specializations

The standard library provides following specializations for