![]() |
Home | Libraries | People | FAQ | More |
template <class T> struct rank : public integral_constant<std::size_t, RANK(T)> {};
Inherits: Class template rank inherits from
integral_constant<std::size_t, RANK(T)>,
where RANK(T) is the
number of array dimensions in type T.
If T is not a (built-in)
array type, then RANK(T) is zero.
Header: #include
<boost/type_traits/rank.hpp>
or #include <boost/type_traits.hpp>
Examples:
rank<int[]>inherits fromintegral_constant<std::size_t, 1>.
rank<double[2][3][4]>::typeis the typeintegral_constant<std::size_t, 3>.
rank<int[1]>::valueis an integral constant expression that evaluates to 1.
rank<int[][2]>::valueis an integral constant expression that evaluates to 2.
rank<int*>::valueis an integral constant expression that evaluates to 0.
rank<boost::array<int, 3> >::valueis an integral constant expression that evaluates to 0:boost::arrayis a class type and not an array type!
rank<T>::value_typeis the typestd::size_t.