File indexing completed on 2025-01-30 10:01:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_TT_RANK_HPP_INCLUDED
0011 #define BOOST_TT_RANK_HPP_INCLUDED
0012
0013 #include <cstddef> // size_t
0014 #include <boost/type_traits/integral_constant.hpp>
0015
0016 namespace boost {
0017
0018 #if !defined( BOOST_CODEGEARC )
0019
0020 namespace detail{
0021
0022 template <class T, std::size_t N>
0023 struct rank_imp
0024 {
0025 BOOST_STATIC_CONSTANT(std::size_t, value = N);
0026 };
0027 #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
0028 template <class T, std::size_t R, std::size_t N>
0029 struct rank_imp<T[R], N>
0030 {
0031 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
0032 };
0033
0034 template <class T, std::size_t R, std::size_t N>
0035 struct rank_imp<T const[R], N>
0036 {
0037 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
0038 };
0039
0040 template <class T, std::size_t R, std::size_t N>
0041 struct rank_imp<T volatile[R], N>
0042 {
0043 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
0044 };
0045
0046 template <class T, std::size_t R, std::size_t N>
0047 struct rank_imp<T const volatile[R], N>
0048 {
0049 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
0050 };
0051
0052 #if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
0053 template <class T, std::size_t N>
0054 struct rank_imp<T[], N>
0055 {
0056 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
0057 };
0058 template <class T, std::size_t N>
0059 struct rank_imp<T const[], N>
0060 {
0061 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
0062 };
0063 template <class T, std::size_t N>
0064 struct rank_imp<T volatile[], N>
0065 {
0066 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
0067 };
0068 template <class T, std::size_t N>
0069 struct rank_imp<T const volatile[], N>
0070 {
0071 BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
0072 };
0073 #endif
0074 #endif
0075 }
0076
0077 #endif
0078
0079 #if defined( BOOST_CODEGEARC )
0080 template <class T> struct rank : public integral_constant<std::size_t, __array_rank(T)>{};
0081 #else
0082 template <class T> struct rank : public integral_constant<std::size_t, (::boost::detail::rank_imp<T, 0>::value)>{};
0083 #endif
0084
0085 }
0086
0087 #endif