sl@0
|
1 |
|
sl@0
|
2 |
#if !defined(BOOST_PP_IS_ITERATING)
|
sl@0
|
3 |
|
sl@0
|
4 |
///// header body
|
sl@0
|
5 |
|
sl@0
|
6 |
#ifndef BOOST_MPL_ARG_HPP_INCLUDED
|
sl@0
|
7 |
#define BOOST_MPL_ARG_HPP_INCLUDED
|
sl@0
|
8 |
|
sl@0
|
9 |
// Copyright Peter Dimov 2001-2002
|
sl@0
|
10 |
// Copyright Aleksey Gurtovoy 2001-2004
|
sl@0
|
11 |
//
|
sl@0
|
12 |
// Distributed under the Boost Software License, Version 1.0.
|
sl@0
|
13 |
// (See accompanying file LICENSE_1_0.txt or copy at
|
sl@0
|
14 |
// http://www.boost.org/LICENSE_1_0.txt)
|
sl@0
|
15 |
//
|
sl@0
|
16 |
// See http://www.boost.org/libs/mpl for documentation.
|
sl@0
|
17 |
|
sl@0
|
18 |
// $Source: /cvsroot/boost/boost/boost/mpl/arg.hpp,v $
|
sl@0
|
19 |
// $Date: 2004/09/21 13:48:07 $
|
sl@0
|
20 |
// $Revision: 1.12 $
|
sl@0
|
21 |
|
sl@0
|
22 |
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
sl@0
|
23 |
# include <boost/mpl/arg_fwd.hpp>
|
sl@0
|
24 |
# include <boost/mpl/aux_/na.hpp>
|
sl@0
|
25 |
# include <boost/mpl/aux_/na_assert.hpp>
|
sl@0
|
26 |
# include <boost/mpl/aux_/arity_spec.hpp>
|
sl@0
|
27 |
# include <boost/mpl/aux_/arg_typedef.hpp>
|
sl@0
|
28 |
#endif
|
sl@0
|
29 |
|
sl@0
|
30 |
#include <boost/mpl/aux_/config/static_constant.hpp>
|
sl@0
|
31 |
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
|
sl@0
|
32 |
|
sl@0
|
33 |
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
sl@0
|
34 |
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
|
sl@0
|
35 |
|
sl@0
|
36 |
# define BOOST_MPL_PREPROCESSED_HEADER arg.hpp
|
sl@0
|
37 |
# include <boost/mpl/aux_/include_preprocessed.hpp>
|
sl@0
|
38 |
|
sl@0
|
39 |
#else
|
sl@0
|
40 |
|
sl@0
|
41 |
# include <boost/mpl/limits/arity.hpp>
|
sl@0
|
42 |
# include <boost/mpl/aux_/preprocessor/default_params.hpp>
|
sl@0
|
43 |
# include <boost/mpl/aux_/preprocessor/params.hpp>
|
sl@0
|
44 |
# include <boost/mpl/aux_/config/lambda.hpp>
|
sl@0
|
45 |
# include <boost/mpl/aux_/config/dtp.hpp>
|
sl@0
|
46 |
# include <boost/mpl/aux_/nttp_decl.hpp>
|
sl@0
|
47 |
|
sl@0
|
48 |
# include <boost/preprocessor/iterate.hpp>
|
sl@0
|
49 |
# include <boost/preprocessor/inc.hpp>
|
sl@0
|
50 |
# include <boost/preprocessor/cat.hpp>
|
sl@0
|
51 |
|
sl@0
|
52 |
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
|
sl@0
|
53 |
|
sl@0
|
54 |
// local macro, #undef-ined at the end of the header
|
sl@0
|
55 |
#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
|
sl@0
|
56 |
# define AUX778076_ARG_N_DEFAULT_PARAMS(param,value) \
|
sl@0
|
57 |
BOOST_MPL_PP_DEFAULT_PARAMS( \
|
sl@0
|
58 |
BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
|
sl@0
|
59 |
, param \
|
sl@0
|
60 |
, value \
|
sl@0
|
61 |
) \
|
sl@0
|
62 |
/**/
|
sl@0
|
63 |
#else
|
sl@0
|
64 |
# define AUX778076_ARG_N_DEFAULT_PARAMS(param,value) \
|
sl@0
|
65 |
BOOST_MPL_PP_PARAMS( \
|
sl@0
|
66 |
BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
|
sl@0
|
67 |
, param \
|
sl@0
|
68 |
) \
|
sl@0
|
69 |
/**/
|
sl@0
|
70 |
#endif
|
sl@0
|
71 |
|
sl@0
|
72 |
#define BOOST_PP_ITERATION_PARAMS_1 \
|
sl@0
|
73 |
(3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/arg.hpp>))
|
sl@0
|
74 |
#include BOOST_PP_ITERATE()
|
sl@0
|
75 |
|
sl@0
|
76 |
|
sl@0
|
77 |
# undef AUX778076_ARG_N_DEFAULT_PARAMS
|
sl@0
|
78 |
|
sl@0
|
79 |
BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(1,int,arg)
|
sl@0
|
80 |
|
sl@0
|
81 |
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
|
sl@0
|
82 |
|
sl@0
|
83 |
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
sl@0
|
84 |
#endif // BOOST_MPL_ARG_HPP_INCLUDED
|
sl@0
|
85 |
|
sl@0
|
86 |
///// iteration
|
sl@0
|
87 |
|
sl@0
|
88 |
#else
|
sl@0
|
89 |
#define i_ BOOST_PP_FRAME_ITERATION(1)
|
sl@0
|
90 |
|
sl@0
|
91 |
#if i_ > 0
|
sl@0
|
92 |
|
sl@0
|
93 |
template<> struct arg<i_>
|
sl@0
|
94 |
{
|
sl@0
|
95 |
BOOST_STATIC_CONSTANT(int, value = i_);
|
sl@0
|
96 |
typedef arg<BOOST_PP_INC(i_)> next;
|
sl@0
|
97 |
BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
|
sl@0
|
98 |
BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
|
sl@0
|
99 |
|
sl@0
|
100 |
template<
|
sl@0
|
101 |
AUX778076_ARG_N_DEFAULT_PARAMS(typename U, na)
|
sl@0
|
102 |
>
|
sl@0
|
103 |
struct apply
|
sl@0
|
104 |
{
|
sl@0
|
105 |
typedef BOOST_PP_CAT(U,i_) type;
|
sl@0
|
106 |
BOOST_MPL_AUX_ASSERT_NOT_NA(type);
|
sl@0
|
107 |
};
|
sl@0
|
108 |
};
|
sl@0
|
109 |
|
sl@0
|
110 |
#else
|
sl@0
|
111 |
|
sl@0
|
112 |
template<> struct arg<-1>
|
sl@0
|
113 |
{
|
sl@0
|
114 |
BOOST_STATIC_CONSTANT(int, value = -1);
|
sl@0
|
115 |
BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
|
sl@0
|
116 |
BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
|
sl@0
|
117 |
|
sl@0
|
118 |
template<
|
sl@0
|
119 |
AUX778076_ARG_N_DEFAULT_PARAMS(typename U, na)
|
sl@0
|
120 |
>
|
sl@0
|
121 |
struct apply
|
sl@0
|
122 |
{
|
sl@0
|
123 |
typedef U1 type;
|
sl@0
|
124 |
BOOST_MPL_AUX_ASSERT_NOT_NA(type);
|
sl@0
|
125 |
};
|
sl@0
|
126 |
};
|
sl@0
|
127 |
|
sl@0
|
128 |
#endif // i_ > 0
|
sl@0
|
129 |
|
sl@0
|
130 |
#undef i_
|
sl@0
|
131 |
#endif // BOOST_PP_IS_ITERATING
|