Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/container/array/tuple element"

From cppreference.com
< cpp‎ | container‎ | array
m (Use since= and until= params of {{dcl}} template.)
(typo)
Line 9: Line 9:
 
{{dcl end}}
 
{{dcl end}}
  
Provides compile-type indexed access to the type of the elements of the array using tuple-like interface
+
Provides compile-time indexed access to the type of the elements of the array using tuple-like interface
  
 
===Member types===
 
===Member types===

Revision as of 20:34, 11 July 2014

 
 
 
 
Defined in header <array>
template< std::size_t I, class T, std::size_t N >
struct tuple_element<I, array<T, N> >;
(since C++11)

Provides compile-time indexed access to the type of the elements of the array using tuple-like interface

Contents

Member types

Member type Definition
type the type of elements of the array

Possible implementation

template<std::size_t I, typename T>
  struct tuple_element;
 
template<std::size_t I, typename T, std::size_t N>
  struct tuple_element<I, std::array<T,N> >
  {
     using type = T;
  };

Example

See also

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