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/mpl/aux_/lambda_support.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 16 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 17 | #define NDNBOOST_TT_AUX_TYPE_TRAIT_DEF1(trait,T,result) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 18 | template< typename T > struct trait \ |
| 19 | { \ |
| 20 | public:\ |
| 21 | typedef result type; \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 22 | NDNBOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 23 | }; \ |
| 24 | \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 25 | NDNBOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 26 | /**/ |
| 27 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 28 | #define NDNBOOST_TT_AUX_TYPE_TRAIT_SPEC1(trait,spec,result) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 29 | template<> struct trait<spec> \ |
| 30 | { \ |
| 31 | public:\ |
| 32 | typedef result type; \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 33 | NDNBOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 34 | }; \ |
| 35 | /**/ |
| 36 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 37 | #define NDNBOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(trait,spec,result) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 38 | template<> struct trait##_impl<spec> \ |
| 39 | { \ |
| 40 | public:\ |
| 41 | typedef result type; \ |
| 42 | }; \ |
| 43 | /**/ |
| 44 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 45 | #define NDNBOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,result) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 46 | template< param > struct trait<spec> \ |
| 47 | { \ |
| 48 | public:\ |
| 49 | typedef result type; \ |
| 50 | }; \ |
| 51 | /**/ |
| 52 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 53 | #define NDNBOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,spec,result) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 54 | template< param1, param2 > struct trait<spec> \ |
| 55 | { \ |
| 56 | public:\ |
| 57 | typedef result; \ |
| 58 | }; \ |
| 59 | /**/ |
| 60 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 61 | #define NDNBOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(param,trait,spec,result) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 62 | template< param > struct trait##_impl<spec> \ |
| 63 | { \ |
| 64 | public:\ |
| 65 | typedef result type; \ |
| 66 | }; \ |
| 67 | /**/ |