Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 1 | |
| 2 | // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION |
| 3 | |
| 4 | // Copyright Aleksey Gurtovoy 2002-2004 |
| 5 | // |
| 6 | // Distributed under the Boost Software License, Version 1.0. |
| 7 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 8 | // http://www.boost.org/LICENSE_1_0.txt) |
| 9 | |
| 10 | // $Source$ |
| 11 | // $Date: 2011-04-25 05:26:48 -0700 (Mon, 25 Apr 2011) $ |
| 12 | // $Revision: 71481 $ |
| 13 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 14 | #include <ndnboost/type_traits/detail/template_arity_spec.hpp> |
| 15 | #include <ndnboost/type_traits/integral_constant.hpp> |
| 16 | #include <ndnboost/mpl/aux_/lambda_support.hpp> |
| 17 | #include <ndnboost/mpl/size_t.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 18 | |
| 19 | #include <cstddef> |
| 20 | |
| 21 | #if !defined(BOOST_MSVC) || BOOST_MSVC >= 1300 |
| 22 | # define BOOST_TT_AUX_SIZE_T_BASE(C) public ::ndnboost::integral_constant<std::size_t,C> |
| 23 | # define BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) /**/ |
| 24 | #else |
| 25 | # define BOOST_TT_AUX_SIZE_T_BASE(C) public ::ndnboost::mpl::size_t<C> |
| 26 | # define BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) \ |
| 27 | typedef ::ndnboost::mpl::size_t<C> base_; \ |
| 28 | using base_::value; \ |
| 29 | /**/ |
| 30 | #endif |
| 31 | |
| 32 | |
| 33 | #define BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(trait,T,C) \ |
| 34 | template< typename T > struct trait \ |
| 35 | : BOOST_TT_AUX_SIZE_T_BASE(C) \ |
| 36 | { \ |
| 37 | public:\ |
| 38 | BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) \ |
| 39 | BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ |
| 40 | }; \ |
| 41 | \ |
| 42 | BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ |
| 43 | /**/ |
| 44 | |
| 45 | #define BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(trait,spec,C) \ |
| 46 | template<> struct trait<spec> \ |
| 47 | : BOOST_TT_AUX_SIZE_T_BASE(C) \ |
| 48 | { \ |
| 49 | public:\ |
| 50 | BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) \ |
| 51 | BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \ |
| 52 | }; \ |
| 53 | /**/ |
| 54 | |
| 55 | #define BOOST_TT_AUX_SIZE_T_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,C) \ |
| 56 | template< param > struct trait<spec> \ |
| 57 | : BOOST_TT_AUX_SIZE_T_BASE(C) \ |
| 58 | { \ |
| 59 | }; \ |
| 60 | /**/ |