]> git.lyx.org Git - features.git/blob - 3rdparty/boost/boost/type_traits/rank.hpp
Exercise: simplify the definition of IconvProcessor
[features.git] / 3rdparty / boost / boost / type_traits / rank.hpp
1
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).
6 //
7 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
8
9
10 #ifndef BOOST_TT_RANK_HPP_INCLUDED
11 #define BOOST_TT_RANK_HPP_INCLUDED
12
13 #include <boost/type_traits/integral_constant.hpp>
14
15 namespace boost {
16
17 #if !defined( __CODEGEARC__ )
18
19 namespace detail{
20
21 template <class T, std::size_t N>
22 struct rank_imp
23 {
24    BOOST_STATIC_CONSTANT(std::size_t, value = N);
25 };
26 #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
27 template <class T, std::size_t R, std::size_t N>
28 struct rank_imp<T[R], N>
29 {
30    BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
31 };
32
33 template <class T, std::size_t R, std::size_t N>
34 struct rank_imp<T const[R], N>
35 {
36    BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
37 };
38
39 template <class T, std::size_t R, std::size_t N>
40 struct rank_imp<T volatile[R], N>
41 {
42    BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
43 };
44
45 template <class T, std::size_t R, std::size_t N>
46 struct rank_imp<T const volatile[R], N>
47 {
48    BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
49 };
50
51 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) &&  !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
52 template <class T, std::size_t N>
53 struct rank_imp<T[], N>
54 {
55    BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
56 };
57 template <class T, std::size_t N>
58 struct rank_imp<T const[], N>
59 {
60    BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
61 };
62 template <class T, std::size_t N>
63 struct rank_imp<T volatile[], N>
64 {
65    BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
66 };
67 template <class T, std::size_t N>
68 struct rank_imp<T const volatile[], N>
69 {
70    BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
71 };
72 #endif
73 #endif
74 }
75
76 #endif // !defined( __CODEGEARC__ )
77
78 #if defined( __CODEGEARC__ )
79 template <class T> struct rank : public integral_constant<std::size_t, __array_rank(T)>{};
80 #else
81 template <class T> struct rank : public integral_constant<std::size_t, (::boost::detail::rank_imp<T, 0>::value)>{};
82 #endif
83
84 } // namespace boost
85
86 #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED