1
//-----------------------------------------------------------------------------
2
// boost mpl/aux_/preprocessor/def_params_tail.hpp header file
3
// See http://www.boost.org for updates, documentation, and revision history.
4
//-----------------------------------------------------------------------------
6
// Copyright (c) 2000-02
9
// Permission to use, copy, modify, distribute and sell this software
10
// and its documentation for any purpose is hereby granted without fee,
11
// provided that the above copyright notice appears in all copies and
12
// that both the copyright notice and this permission notice appear in
13
// supporting documentation. No representations are made about the
14
// suitability of this software for any purpose. It is provided "as is"
15
// without express or implied warranty.
17
#ifndef BOOST_MPL_AUX_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED
18
#define BOOST_MPL_AUX_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED
20
#include "boost/mpl/limits/arity.hpp"
21
#include "boost/mpl/aux_/config/dtp.hpp"
22
#include "boost/mpl/aux_/config/preprocessor.hpp"
24
#include "boost/preprocessor/comma_if.hpp"
25
#include "boost/preprocessor/logical/and.hpp"
26
#include "boost/preprocessor/identity.hpp"
27
#include "boost/preprocessor/empty.hpp"
29
// BOOST_MPL_PP_DEF_PARAMS_TAIL(1,T): , T1 = void_, .., Tn = void_
30
// BOOST_MPL_PP_DEF_PARAMS_TAIL(2,T): , T2 = void_, .., Tn = void_
31
// BOOST_MPL_PP_DEF_PARAMS_TAIL(n,T): <nothing>
33
#if !defined(BOOST_MPL_NO_OWN_PP_PRIMITIVES)
35
# include "boost/mpl/aux_/preprocessor/filter_params.hpp"
36
# include "boost/mpl/aux_/preprocessor/sub.hpp"
38
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, value_func) \
39
BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_1( \
41
, BOOST_MPL_PP_SUB(BOOST_MPL_METAFUNCTION_MAX_ARITY,i) \
47
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_1(i, n, param, value_func) \
48
BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_2(i,n,param,value_func) \
51
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_2(i, n, param, value_func) \
52
BOOST_PP_COMMA_IF(BOOST_PP_AND(i,n)) \
53
BOOST_MPL_PP_DEF_PARAMS_TAIL_##i(n,param,value_func) \
56
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_0(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##1 v(),p##2 v(),p##3 v(),p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v())
57
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_1(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##2 v(),p##3 v(),p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1)
58
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_2(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##3 v(),p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2)
59
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_3(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2,p3)
60
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_4(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2,p3,p4)
61
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_5(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2,p3,p4,p5)
62
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_6(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##7 v(),p##8 v(),p##9 v(),p1,p2,p3,p4,p5,p6)
63
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_7(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##8 v(),p##9 v(),p1,p2,p3,p4,p5,p6,p7)
64
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_8(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##9 v(),p1,p2,p3,p4,p5,p6,p7,p8)
65
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_9(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p1,p2,p3,p4,p5,p6,p7,p8,p9)
69
# include "boost/preprocessor/arithmetic/add.hpp"
70
# include "boost/preprocessor/arithmetic/sub.hpp"
71
# include "boost/preprocessor/inc.hpp"
72
# include "boost/preprocessor/tuple/elem.hpp"
73
# include "boost/preprocessor/repeat.hpp"
74
# include "boost/preprocessor/cat.hpp"
76
# define BOOST_MPL_PP_AUX_TAIL_PARAM_FUNC(unused, i, op) \
77
BOOST_PP_COMMA_IF(i) \
79
BOOST_PP_TUPLE_ELEM(3, 1, op) \
80
, BOOST_PP_ADD_D(1, i, BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3, 0, op))) \
81
) BOOST_PP_TUPLE_ELEM(3, 2, op)() \
84
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, value_func) \
86
BOOST_PP_SUB_D(1, BOOST_MPL_METAFUNCTION_MAX_ARITY, i) \
87
, BOOST_MPL_PP_AUX_TAIL_PARAM_FUNC \
88
, (i, param, value_func) \
92
#endif // BOOST_MPL_NO_OWN_PP_PRIMITIVES
94
#define BOOST_MPL_PP_DEF_PARAMS_TAIL(i, param, value) \
95
BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_IDENTITY(=value)) \
98
#if !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
99
# define BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, param, value) \
100
BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_IDENTITY(=value)) \
103
# define BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, param, value) \
104
BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_EMPTY) \
108
#endif // BOOST_MPL_AUX_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED