2 // (C) Copyright John Maddock 2005.
3 // Use, modification and distribution are subject to the Boost Software License,
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt).
7 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
10 #ifndef BOOST_TT_RANK_HPP_INCLUDED
11 #define BOOST_TT_RANK_HPP_INCLUDED
13 // should be the last #include
14 #include "boost/type_traits/detail/size_t_trait_def.hpp"
20 template <class T, std::size_t N>
23 BOOST_STATIC_CONSTANT(std::size_t, value = N);
25 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
26 template <class T, std::size_t R, std::size_t N>
27 struct rank_imp<T[R], N>
29 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
32 template <class T, std::size_t R, std::size_t N>
33 struct rank_imp<T const[R], N>
35 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
38 template <class T, std::size_t R, std::size_t N>
39 struct rank_imp<T volatile[R], N>
41 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
44 template <class T, std::size_t R, std::size_t N>
45 struct rank_imp<T const volatile[R], N>
47 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
50 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
51 template <class T, std::size_t N>
52 struct rank_imp<T[], N>
54 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
56 template <class T, std::size_t N>
57 struct rank_imp<T const[], N>
59 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
61 template <class T, std::size_t N>
62 struct rank_imp<T volatile[], N>
64 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
66 template <class T, std::size_t N>
67 struct rank_imp<T const volatile[], N>
69 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
75 BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,(::boost::detail::rank_imp<T,0>::value))
79 #include "boost/type_traits/detail/size_t_trait_undef.hpp"
81 #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED