std::tuple_element<std::pair>

From Cppreference

Jump to: navigation, search
Defined in header <utility>

template< class T1, class T2 >
struct tuple_element<0, std::pair<T1,T2> >;
(1) (C++11 feature)
template< class T1, class T2 >
struct tuple_element<1, std::pair<T1,T2> >;
(2) (C++11 feature)

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

[edit] Member types

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

[edit] Example

[edit] See also

tuple_size (C++11)
obtains the size of a pair
(class template specialization)