Chris@16
|
1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
Chris@16
|
2
|
Chris@16
|
3 #include <boost/proto/detail/preprocessed/args.hpp>
|
Chris@16
|
4
|
Chris@16
|
5 #elif !defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
6
|
Chris@16
|
7 /// INTERNAL ONLY
|
Chris@16
|
8 ///
|
Chris@16
|
9 #define BOOST_PROTO_DEFINE_CHILD_N(Z, N, DATA) \
|
Chris@16
|
10 typedef BOOST_PP_CAT(Arg, N) BOOST_PP_CAT(child, N); \
|
Chris@16
|
11 /**< INTERNAL ONLY */
|
Chris@16
|
12
|
Chris@16
|
13 /// INTERNAL ONLY
|
Chris@16
|
14 ///
|
Chris@16
|
15 #define BOOST_PROTO_DEFINE_VOID_N(z, n, data) \
|
Chris@16
|
16 typedef mpl::void_ BOOST_PP_CAT(child, n); \
|
Chris@16
|
17 /**< INTERNAL ONLY */
|
Chris@16
|
18
|
Chris@16
|
19 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
20 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/args.hpp")
|
Chris@16
|
21 #endif
|
Chris@16
|
22
|
Chris@16
|
23 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
24 /// \file args.hpp
|
Chris@16
|
25 /// Contains definition of \c term\<\>, \c list1\<\>, \c list2\<\>, ...
|
Chris@16
|
26 /// class templates.
|
Chris@16
|
27 //
|
Chris@16
|
28 // Copyright 2008 Eric Niebler. Distributed under the Boost
|
Chris@16
|
29 // Software License, Version 1.0. (See accompanying file
|
Chris@16
|
30 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
31
|
Chris@16
|
32 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
33 #pragma wave option(preserve: 1)
|
Chris@16
|
34 #endif
|
Chris@16
|
35
|
Chris@16
|
36 /// \brief A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
|
Chris@16
|
37 ///
|
Chris@16
|
38 /// A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
|
Chris@16
|
39 /// The types in the sequence correspond to the children of a node in an expression tree.
|
Chris@16
|
40 template< typename Arg0 >
|
Chris@16
|
41 struct term
|
Chris@16
|
42 {
|
Chris@16
|
43 static const long arity = 0;
|
Chris@16
|
44 typedef Arg0 child0;
|
Chris@16
|
45 BOOST_PP_REPEAT_FROM_TO(1, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_DEFINE_VOID_N, ~)
|
Chris@16
|
46
|
Chris@16
|
47 /// INTERNAL ONLY
|
Chris@16
|
48 ///
|
Chris@16
|
49 typedef Arg0 back_;
|
Chris@16
|
50 };
|
Chris@16
|
51
|
Chris@16
|
52 #define BOOST_PP_ITERATION_PARAMS_1 \
|
Chris@16
|
53 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/args.hpp>))
|
Chris@16
|
54 #include BOOST_PP_ITERATE()
|
Chris@16
|
55
|
Chris@16
|
56 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
57 #pragma wave option(output: null)
|
Chris@16
|
58 #endif
|
Chris@16
|
59
|
Chris@16
|
60 #undef BOOST_PROTO_DEFINE_VOID_N
|
Chris@16
|
61 #undef BOOST_PROTO_DEFINE_CHILD_N
|
Chris@16
|
62
|
Chris@16
|
63 #else
|
Chris@16
|
64
|
Chris@16
|
65 #define N BOOST_PP_ITERATION()
|
Chris@16
|
66
|
Chris@16
|
67 /// \brief A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
|
Chris@16
|
68 ///
|
Chris@16
|
69 /// A type sequence, for use as the 2nd parameter to the \c expr\<\> class template.
|
Chris@16
|
70 /// The types in the sequence correspond to the children of a node in an expression tree.
|
Chris@16
|
71 template< BOOST_PP_ENUM_PARAMS(N, typename Arg) >
|
Chris@16
|
72 struct BOOST_PP_CAT(list, N)
|
Chris@16
|
73 {
|
Chris@16
|
74 static const long arity = N;
|
Chris@16
|
75 BOOST_PP_REPEAT(N, BOOST_PROTO_DEFINE_CHILD_N, ~)
|
Chris@16
|
76 BOOST_PP_REPEAT_FROM_TO(N, BOOST_PROTO_MAX_ARITY, BOOST_PROTO_DEFINE_VOID_N, ~)
|
Chris@16
|
77
|
Chris@16
|
78 /// INTERNAL ONLY
|
Chris@16
|
79 ///
|
Chris@16
|
80 typedef BOOST_PP_CAT(Arg, BOOST_PP_DEC(N)) back_;
|
Chris@16
|
81 };
|
Chris@16
|
82
|
Chris@16
|
83 #undef N
|
Chris@16
|
84
|
Chris@16
|
85 #endif
|