Namespaces
Variants
Views
Actions

std::tuple_element<std::tuple>

From cppreference.com
Defined in header <tuple>
template< std::size_t I, class T >
class tuple_element; /* undefined */
(1) (since C++11)
template< std::size_t I, class... Types >
class tuple_element< I, tuple<Types...> >;
(2) (since C++11)
template< std::size_t I, class T >

class tuple_element< I, const T > {
  typedef typename
      std::add_const<typename std::tuple_element<I, T>::type>::type type;

};
(3) (since C++11)
template< std::size_t I, class T >

class tuple_element< I, volatile T > {
  typedef typename
      std::add_volatile<typename std::tuple_element<I, T>::type>::type type;

};
(4) (since C++11)
template< size_t I, class T >

class tuple_element< I, const volatile T > {
  typedef typename
      std::add_cv<typename std::tuple_element<I, T>::type>::type type;

};
(5) (since C++11)

Provides compile-type indexed access to the types of the elements of the tuple.

Contents

[edit] Member types

Member type Definition
type the type of Ith element of the tuple, where I is in [0, sizeof...(Types))

[edit] Possible implementation

[edit] Example

[edit] See also

obtains the type of the elements of array
(class template specialization) [edit]
obtains the type of the elements of pair
(class template specialization) [edit]