std::tuple_element<std::pair> (3) - Linux Manuals
std::tuple_element<std::pair>: std::tuple_element<std::pair>
NAME
std::tuple_element<std::pair> - std::tuple_element<std::pair>
Synopsis
Defined in header <utility>
template< std::size_t I, class T1, class T2 > (since C++11)
struct tuple_element<I, std::pair<T1, T2>>;
The partial specializations of std::tuple_element for pairs provide compile-time access to the types of the pair's elements, using tuple-like syntax. The program is ill-formed if I >= 2
Member types
Member type Definition
type T1 if I == 0
Possible implementation
Example
// Run this code
Output:
Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior
LWG_2974 C++11 out-of-bounds index referred the undefined primary template made ill-formed (hard error)
See also
tuple_element (class template specialization)
std::tuple_element<std::array> (class template specialization)
std::tuple_size<std::pair> obtains the size of a pair
(C++11)