blob: 440164ab6bac3967a39b6b5f4c630ffe9bc77f48 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
Jeff Thompson3d613fd2013-10-15 15:39:04 -07002#if !defined(NDNBOOST_PP_IS_ITERATING)
Jeff Thompsona28eed82013-08-22 16:21:10 -07003
4///// header body
5
Jeff Thompson3d613fd2013-10-15 15:39:04 -07006#ifndef NDNBOOST_MPL_ARG_HPP_INCLUDED
7#define NDNBOOST_MPL_ARG_HPP_INCLUDED
Jeff Thompsona28eed82013-08-22 16:21:10 -07008
9// Copyright Peter Dimov 2001-2002
10// Copyright Aleksey Gurtovoy 2001-2004
11//
12// Distributed under the Boost Software License, Version 1.0.
13// (See accompanying file LICENSE_1_0.txt or copy at
14// http://www.boost.org/LICENSE_1_0.txt)
15//
16// See http://www.boost.org/libs/mpl for documentation.
17
18// $Id: arg.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
19// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
20// $Revision: 49267 $
21
Jeff Thompson3d613fd2013-10-15 15:39:04 -070022#if !defined(NDNBOOST_MPL_PREPROCESSING_MODE)
Jeff Thompsona28eed82013-08-22 16:21:10 -070023# include <ndnboost/mpl/arg_fwd.hpp>
24# include <ndnboost/mpl/aux_/na.hpp>
25# include <ndnboost/mpl/aux_/na_assert.hpp>
26# include <ndnboost/mpl/aux_/arity_spec.hpp>
27# include <ndnboost/mpl/aux_/arg_typedef.hpp>
28#endif
29
30#include <ndnboost/mpl/aux_/config/static_constant.hpp>
31#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
32
Jeff Thompson3d613fd2013-10-15 15:39:04 -070033#if !defined(NDNBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
34 && !defined(NDNBOOST_MPL_PREPROCESSING_MODE)
Jeff Thompsona28eed82013-08-22 16:21:10 -070035
Jeff Thompson3d613fd2013-10-15 15:39:04 -070036# define NDNBOOST_MPL_PREPROCESSED_HEADER arg.hpp
Jeff Thompsona28eed82013-08-22 16:21:10 -070037# include <ndnboost/mpl/aux_/include_preprocessed.hpp>
38
39#else
40
41# include <ndnboost/mpl/limits/arity.hpp>
42# include <ndnboost/mpl/aux_/preprocessor/default_params.hpp>
43# include <ndnboost/mpl/aux_/preprocessor/params.hpp>
44# include <ndnboost/mpl/aux_/config/lambda.hpp>
45# include <ndnboost/mpl/aux_/config/dtp.hpp>
46# include <ndnboost/mpl/aux_/nttp_decl.hpp>
47
48# include <ndnboost/preprocessor/iterate.hpp>
49# include <ndnboost/preprocessor/inc.hpp>
50# include <ndnboost/preprocessor/cat.hpp>
51
Jeff Thompson3d613fd2013-10-15 15:39:04 -070052NDNBOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
Jeff Thompsona28eed82013-08-22 16:21:10 -070053
54// local macro, #undef-ined at the end of the header
Jeff Thompson3d613fd2013-10-15 15:39:04 -070055#if !defined(NDNBOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
Jeff Thompsona28eed82013-08-22 16:21:10 -070056# define AUX778076_ARG_N_DEFAULT_PARAMS(param,value) \
Jeff Thompson3d613fd2013-10-15 15:39:04 -070057 NDNBOOST_MPL_PP_DEFAULT_PARAMS( \
58 NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY \
Jeff Thompsona28eed82013-08-22 16:21:10 -070059 , param \
60 , value \
61 ) \
62 /**/
63#else
64# define AUX778076_ARG_N_DEFAULT_PARAMS(param,value) \
Jeff Thompson3d613fd2013-10-15 15:39:04 -070065 NDNBOOST_MPL_PP_PARAMS( \
66 NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY \
Jeff Thompsona28eed82013-08-22 16:21:10 -070067 , param \
68 ) \
69 /**/
70#endif
71
Jeff Thompson3d613fd2013-10-15 15:39:04 -070072#define NDNBOOST_PP_ITERATION_PARAMS_1 \
73 (3,(0, NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY, <ndnboost/mpl/arg.hpp>))
74#include NDNBOOST_PP_ITERATE()
Jeff Thompsona28eed82013-08-22 16:21:10 -070075
76
77# undef AUX778076_ARG_N_DEFAULT_PARAMS
78
Jeff Thompson3d613fd2013-10-15 15:39:04 -070079NDNBOOST_MPL_AUX_NONTYPE_ARITY_SPEC(1,int,arg)
Jeff Thompsona28eed82013-08-22 16:21:10 -070080
Jeff Thompson3d613fd2013-10-15 15:39:04 -070081NDNBOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
Jeff Thompsona28eed82013-08-22 16:21:10 -070082
Jeff Thompson3d613fd2013-10-15 15:39:04 -070083#endif // NDNBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
84#endif // NDNBOOST_MPL_ARG_HPP_INCLUDED
Jeff Thompsona28eed82013-08-22 16:21:10 -070085
86///// iteration
87
88#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070089#define i_ NDNBOOST_PP_FRAME_ITERATION(1)
Jeff Thompsona28eed82013-08-22 16:21:10 -070090
91#if i_ > 0
92
93template<> struct arg<i_>
94{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070095 NDNBOOST_STATIC_CONSTANT(int, value = i_);
96 typedef arg<NDNBOOST_PP_INC(i_)> next;
97 NDNBOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
98 NDNBOOST_MPL_AUX_ARG_TYPEDEF(na, type)
Jeff Thompsona28eed82013-08-22 16:21:10 -070099
100 template<
101 AUX778076_ARG_N_DEFAULT_PARAMS(typename U, na)
102 >
103 struct apply
104 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700105 typedef NDNBOOST_PP_CAT(U,i_) type;
106 NDNBOOST_MPL_AUX_ASSERT_NOT_NA(type);
Jeff Thompsona28eed82013-08-22 16:21:10 -0700107 };
108};
109
110#else
111
112template<> struct arg<-1>
113{
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700114 NDNBOOST_STATIC_CONSTANT(int, value = -1);
115 NDNBOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
116 NDNBOOST_MPL_AUX_ARG_TYPEDEF(na, type)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700117
118 template<
119 AUX778076_ARG_N_DEFAULT_PARAMS(typename U, na)
120 >
121 struct apply
122 {
123 typedef U1 type;
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700124 NDNBOOST_MPL_AUX_ASSERT_NOT_NA(type);
Jeff Thompsona28eed82013-08-22 16:21:10 -0700125 };
126};
127
128#endif // i_ > 0
129
130#undef i_
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700131#endif // NDNBOOST_PP_IS_ITERATING