Defined in header <utility> template< class T1, class T2 >
struct tuple_size<std::pair<T1, T2>>; (since C++11) (until C++14) template <class T1, class T2>
struct tuple_size<std::pair<T1, T2>>
: std::integral_constant<std::size_t, 2> { }; (since C++14)
The partial specialization of std::tuple_size for pairs provides a compile-time way to obtain the number of elements in a pair, which is always 2, using tuple-like syntax.