blob: 2a4f62f9d520471684be32eb753b3c542b0b30bd [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
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
Jeff Thompson3d613fd2013-10-15 15:39:04 -070010#ifndef NDNBOOST_TT_RANK_HPP_INCLUDED
11#define NDNBOOST_TT_RANK_HPP_INCLUDED
Jeff Thompsona28eed82013-08-22 16:21:10 -070012
13// should be the last #include
14#include <ndnboost/type_traits/detail/size_t_trait_def.hpp>
15
16namespace ndnboost {
17
18#if !defined( __CODEGEARC__ )
19
20namespace detail{
21
22template <class T, std::size_t N>
23struct rank_imp
24{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070025 NDNBOOST_STATIC_CONSTANT(std::size_t, value = N);
Jeff Thompsona28eed82013-08-22 16:21:10 -070026};
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027#if !defined(NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(NDNBOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
Jeff Thompsona28eed82013-08-22 16:21:10 -070028template <class T, std::size_t R, std::size_t N>
29struct rank_imp<T[R], N>
30{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070031 NDNBOOST_STATIC_CONSTANT(std::size_t, value = (::ndnboost::detail::rank_imp<T, N+1>::value));
Jeff Thompsona28eed82013-08-22 16:21:10 -070032};
33
34template <class T, std::size_t R, std::size_t N>
35struct rank_imp<T const[R], N>
36{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070037 NDNBOOST_STATIC_CONSTANT(std::size_t, value = (::ndnboost::detail::rank_imp<T, N+1>::value));
Jeff Thompsona28eed82013-08-22 16:21:10 -070038};
39
40template <class T, std::size_t R, std::size_t N>
41struct rank_imp<T volatile[R], N>
42{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070043 NDNBOOST_STATIC_CONSTANT(std::size_t, value = (::ndnboost::detail::rank_imp<T, N+1>::value));
Jeff Thompsona28eed82013-08-22 16:21:10 -070044};
45
46template <class T, std::size_t R, std::size_t N>
47struct rank_imp<T const volatile[R], N>
48{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070049 NDNBOOST_STATIC_CONSTANT(std::size_t, value = (::ndnboost::detail::rank_imp<T, N+1>::value));
Jeff Thompsona28eed82013-08-22 16:21:10 -070050};
51
Jeff Thompson3d613fd2013-10-15 15:39:04 -070052#if !NDNBOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !NDNBOOST_WORKAROUND(__DMC__, NDNBOOST_TESTED_AT(0x840))
Jeff Thompsona28eed82013-08-22 16:21:10 -070053template <class T, std::size_t N>
54struct rank_imp<T[], N>
55{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070056 NDNBOOST_STATIC_CONSTANT(std::size_t, value = (::ndnboost::detail::rank_imp<T, N+1>::value));
Jeff Thompsona28eed82013-08-22 16:21:10 -070057};
58template <class T, std::size_t N>
59struct rank_imp<T const[], N>
60{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070061 NDNBOOST_STATIC_CONSTANT(std::size_t, value = (::ndnboost::detail::rank_imp<T, N+1>::value));
Jeff Thompsona28eed82013-08-22 16:21:10 -070062};
63template <class T, std::size_t N>
64struct rank_imp<T volatile[], N>
65{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070066 NDNBOOST_STATIC_CONSTANT(std::size_t, value = (::ndnboost::detail::rank_imp<T, N+1>::value));
Jeff Thompsona28eed82013-08-22 16:21:10 -070067};
68template <class T, std::size_t N>
69struct rank_imp<T const volatile[], N>
70{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070071 NDNBOOST_STATIC_CONSTANT(std::size_t, value = (::ndnboost::detail::rank_imp<T, N+1>::value));
Jeff Thompsona28eed82013-08-22 16:21:10 -070072};
73#endif
74#endif
75}
76
77#endif // !defined( __CODEGEARC__ )
78
79#if defined( __CODEGEARC__ )
Jeff Thompson3d613fd2013-10-15 15:39:04 -070080NDNBOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,__array_rank(T))
Jeff Thompsona28eed82013-08-22 16:21:10 -070081#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070082NDNBOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,(::ndnboost::detail::rank_imp<T,0>::value))
Jeff Thompsona28eed82013-08-22 16:21:10 -070083#endif
84
85} // namespace ndnboost
86
87#include <ndnboost/type_traits/detail/size_t_trait_undef.hpp>
88
Jeff Thompson3d613fd2013-10-15 15:39:04 -070089#endif // NDNBOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED