blob: 83d0444cf81bd6a077572fa58bf47599f232220a [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001
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 Thompson2277ce52013-08-01 17:34:11 -070014#include <ndnboost/type_traits/detail/template_arity_spec.hpp>
15#include <ndnboost/mpl/aux_/lambda_support.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070016
Jeff Thompson3d613fd2013-10-15 15:39:04 -070017#define NDNBOOST_TT_AUX_TYPE_TRAIT_DEF1(trait,T,result) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070018template< typename T > struct trait \
19{ \
20public:\
21 typedef result type; \
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022 NDNBOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070023}; \
24\
Jeff Thompson3d613fd2013-10-15 15:39:04 -070025NDNBOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070026/**/
27
Jeff Thompson3d613fd2013-10-15 15:39:04 -070028#define NDNBOOST_TT_AUX_TYPE_TRAIT_SPEC1(trait,spec,result) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070029template<> struct trait<spec> \
30{ \
31public:\
32 typedef result type; \
Jeff Thompson3d613fd2013-10-15 15:39:04 -070033 NDNBOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070034}; \
35/**/
36
Jeff Thompson3d613fd2013-10-15 15:39:04 -070037#define NDNBOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(trait,spec,result) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070038template<> struct trait##_impl<spec> \
39{ \
40public:\
41 typedef result type; \
42}; \
43/**/
44
Jeff Thompson3d613fd2013-10-15 15:39:04 -070045#define NDNBOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,result) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070046template< param > struct trait<spec> \
47{ \
48public:\
49 typedef result type; \
50}; \
51/**/
52
Jeff Thompson3d613fd2013-10-15 15:39:04 -070053#define NDNBOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,spec,result) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070054template< param1, param2 > struct trait<spec> \
55{ \
56public:\
57 typedef result; \
58}; \
59/**/
60
Jeff Thompson3d613fd2013-10-15 15:39:04 -070061#define NDNBOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(param,trait,spec,result) \
Jeff Thompsonf7d49942013-08-01 16:47:40 -070062template< param > struct trait##_impl<spec> \
63{ \
64public:\
65 typedef result type; \
66}; \
67/**/