Namespaces
Variants
Views
Actions

std::tuple_element<std::array>

From cppreference.com
< cpp‎ | container‎ | array
Revision as of 09:19, 28 March 2012 by P12 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:cpp/utility/tuple/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <tuple>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
template< std::size_t I, class T >
class tuple_element; /* undefined */
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
template< std::size_t I, class... Types >
class tuple_element< I, tuple<Types...> >;
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
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;

};
</td>

<td > (3) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
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;

};
</td>

<td > (4) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
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;

};
</td>

<td > (5) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

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

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list end

Possible implementation

Template:eq fun cpp

Example

Template:example cpp

See also

Template:cpp/container/array/dcl list tuple element
obtains the type of the elements of pair
(class template specialization) [edit]