Chris@16
|
1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
Chris@16
|
2
|
Chris@16
|
3 #include <boost/proto/detail/preprocessed/generate_by_value.hpp>
|
Chris@16
|
4
|
Chris@16
|
5 #elif !defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
6
|
Chris@16
|
7 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
8 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/generate_by_value.hpp")
|
Chris@16
|
9 #endif
|
Chris@16
|
10
|
Chris@16
|
11 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
12 /// \file generate_by_value.hpp
|
Chris@16
|
13 /// Contains definition of by_value_generator_\<\> class template.
|
Chris@16
|
14 //
|
Chris@16
|
15 // Copyright 2008 Eric Niebler. Distributed under the Boost
|
Chris@16
|
16 // Software License, Version 1.0. (See accompanying file
|
Chris@16
|
17 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
18
|
Chris@16
|
19 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
20 #pragma wave option(preserve: 1)
|
Chris@16
|
21 #endif
|
Chris@16
|
22
|
Chris@16
|
23 #define BOOST_PP_ITERATION_PARAMS_1 \
|
Chris@16
|
24 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/generate_by_value.hpp>))
|
Chris@16
|
25 #include BOOST_PP_ITERATE()
|
Chris@16
|
26
|
Chris@16
|
27 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
28 #pragma wave option(output: null)
|
Chris@16
|
29 #endif
|
Chris@16
|
30
|
Chris@16
|
31 #else // BOOST_PP_IS_ITERATING
|
Chris@16
|
32
|
Chris@16
|
33 #define N BOOST_PP_ITERATION()
|
Chris@16
|
34
|
Chris@16
|
35 template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
|
Chris@16
|
36 struct by_value_generator_<
|
Chris@16
|
37 proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
|
Chris@16
|
38 >
|
Chris@16
|
39 {
|
Chris@16
|
40 typedef
|
Chris@16
|
41 BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
|
Chris@16
|
42 src_args;
|
Chris@16
|
43
|
Chris@16
|
44 typedef
|
Chris@16
|
45 BOOST_PP_CAT(list, N)<
|
Chris@16
|
46 BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
|
Chris@16
|
47 >
|
Chris@16
|
48 dst_args;
|
Chris@16
|
49
|
Chris@16
|
50 typedef proto::expr<Tag, src_args, N> src_type;
|
Chris@16
|
51 typedef proto::expr<Tag, dst_args, N> type;
|
Chris@16
|
52
|
Chris@16
|
53 BOOST_FORCEINLINE
|
Chris@16
|
54 static type const call(src_type const &e)
|
Chris@16
|
55 {
|
Chris@16
|
56 type that = {
|
Chris@16
|
57 BOOST_PP_ENUM_PARAMS(N, e.child)
|
Chris@16
|
58 };
|
Chris@16
|
59 return that;
|
Chris@16
|
60 }
|
Chris@16
|
61 };
|
Chris@16
|
62
|
Chris@16
|
63 template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Arg) >
|
Chris@16
|
64 struct by_value_generator_<
|
Chris@16
|
65 proto::basic_expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>, N>
|
Chris@16
|
66 >
|
Chris@16
|
67 {
|
Chris@16
|
68 typedef
|
Chris@16
|
69 BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, Arg)>
|
Chris@16
|
70 src_args;
|
Chris@16
|
71
|
Chris@16
|
72 typedef
|
Chris@16
|
73 BOOST_PP_CAT(list, N)<
|
Chris@16
|
74 BOOST_PP_ENUM_BINARY_PARAMS(N, typename uncvref<Arg, >::type BOOST_PP_INTERCEPT)
|
Chris@16
|
75 >
|
Chris@16
|
76 dst_args;
|
Chris@16
|
77
|
Chris@16
|
78 typedef proto::basic_expr<Tag, src_args, N> src_type;
|
Chris@16
|
79 typedef proto::basic_expr<Tag, dst_args, N> type;
|
Chris@16
|
80
|
Chris@16
|
81 BOOST_FORCEINLINE
|
Chris@16
|
82 static type const call(src_type const &e)
|
Chris@16
|
83 {
|
Chris@16
|
84 type that = {
|
Chris@16
|
85 BOOST_PP_ENUM_PARAMS(N, e.child)
|
Chris@16
|
86 };
|
Chris@16
|
87 return that;
|
Chris@16
|
88 }
|
Chris@16
|
89 };
|
Chris@16
|
90
|
Chris@16
|
91 #undef N
|
Chris@16
|
92
|
Chris@16
|
93 #endif
|