class template specialization
<utility>
std::tuple_size<pair>
unspecialized | template <class Tpl> class tuple_size; |
---|
pair specialization | template <class T1, class T2> struct tuple_size< pair<T1,T2> >; |
---|
Tuple traits for pair
Accesses the size of a pair object as if it was a tuple.
This class provides the size of the
pair (which is always
2
) as the
constexpr
member
value of type
size_t, as if inheriting
integral_constant:
This class provides the size of the
pair (which is always
2
) as the
constexpr
member
value of type
size_t by inheriting
integral_constant:
1 2 3
|
template <class Tpl> class tuple_size;
template <class T1, class T2>
struct tuple_size< pair<T1,T2> > : integral_constant <size_t,2> {};
|
See tuple_size for more information.
Template parameters
- Tpl
- Tuple-like type. For this specialization:
pair<T1,T2>
.
- T1, T2
- Type of the elements in the pair.
Member contants
member constant | definition |
value | (size_t)2 |
size_t is an unsigned integral type.