Namespaces
Variants
Views
Actions

std::tuple_element<std::pair>

From cppreference.com
< cpp‎ | utility‎ | pair
Revision as of 12:59, 2 November 2012 by P12bot (Talk | contribs)

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <utility>
</td>

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

<tr class="t-dcl ">

<td >
template< class T1, class T2 >
struct tuple_element<0, std::pair<T1,T2> >;
</td>

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

<tr class="t-dcl ">

<td >
template< class T1, class T2 >
struct tuple_element<1, std::pair<T1,T2> >;
</td>

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

The partial specializations of std::tuple_element for pairs provide a compile-time way to obtain the types of the pair's elements, using tuple-like syntax.

Contents

Member types

First version
Member type Definition
type T1
Second version
Member type Definition
type T2

Example

See also

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