]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) |
2 | ||
3 | #include <boost/phoenix/core/detail/cpp03/preprocessed/function_eval.hpp> | |
4 | ||
5 | #else | |
6 | ||
7 | #if !BOOST_PHOENIX_IS_ITERATING | |
8 | ||
9 | #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) | |
10 | #pragma wave option(preserve: 2, line: 0, output: "preprocessed/function_eval_" BOOST_PHOENIX_LIMIT_STR ".hpp") | |
11 | #endif | |
12 | /*============================================================================= | |
13 | Copyright (c) 2001-2007 Joel de Guzman | |
14 | ||
15 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
16 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
17 | ==============================================================================*/ | |
18 | ||
19 | #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) | |
20 | #pragma wave option(preserve: 1) | |
21 | #endif | |
22 | ||
23 | #define PHOENIX_GET_ARG(z, n, data) \ | |
24 | typedef \ | |
25 | typename boost::add_reference< \ | |
26 | typename boost::add_const< \ | |
27 | typename boost::result_of< \ | |
28 | boost::phoenix::evaluator( \ | |
29 | BOOST_PP_CAT(A, n) \ | |
30 | , Context \ | |
31 | ) \ | |
32 | >::type \ | |
33 | >::type \ | |
34 | >::type \ | |
35 | BOOST_PP_CAT(a, n); | |
36 | ||
37 | #define PHOENIX_EVAL_ARG(z, n, data) \ | |
38 | help_rvalue_deduction(boost::phoenix::eval(BOOST_PP_CAT(a, n), ctx)) | |
39 | ||
40 | #define M0(z, n, data) \ | |
41 | typename proto::detail::uncvref<BOOST_PP_CAT(a, n)>::type | |
42 | ||
43 | #define BOOST_PHOENIX_ITERATION_PARAMS \ | |
44 | (3, (1, BOOST_PP_DEC(BOOST_PHOENIX_ACTOR_LIMIT), \ | |
45 | <boost/phoenix/core/detail/cpp03/function_eval.hpp>)) | |
46 | #include BOOST_PHOENIX_ITERATE() | |
47 | ||
48 | #undef PHOENIX_GET_ARG | |
49 | #undef PHOENIX_EVAL_ARG | |
50 | #undef M0 | |
51 | ||
52 | #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) | |
53 | #pragma wave option(output: null) | |
54 | #endif | |
55 | ||
56 | #else | |
57 | template < | |
58 | typename This | |
59 | , typename F | |
60 | , BOOST_PHOENIX_typename_A | |
61 | , typename Context | |
62 | > | |
63 | struct result<This(F, BOOST_PHOENIX_A, Context)> | |
64 | { | |
65 | typedef typename | |
66 | remove_reference< | |
67 | typename boost::result_of<evaluator(F, Context)>::type | |
68 | >::type | |
69 | fn; | |
70 | ||
71 | BOOST_PP_REPEAT(BOOST_PHOENIX_ITERATION, PHOENIX_GET_ARG, _) | |
72 | ||
73 | typedef typename | |
74 | boost::result_of<fn(BOOST_PHOENIX_a)>::type | |
75 | type; | |
76 | /* | |
77 | typedef typename | |
78 | mpl::eval_if_c< | |
79 | has_phx2_result< | |
80 | fn | |
81 | , BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, M0, _) | |
82 | >::value | |
83 | , boost::result_of< | |
84 | fn( | |
85 | BOOST_PHOENIX_a | |
86 | ) | |
87 | > | |
88 | , phx2_result< | |
89 | fn | |
90 | , BOOST_PHOENIX_a | |
91 | > | |
92 | >::type | |
93 | type; | |
94 | */ | |
95 | }; | |
96 | ||
97 | template <typename F, BOOST_PHOENIX_typename_A, typename Context> | |
98 | typename result< | |
99 | function_eval( | |
100 | F const & | |
101 | , BOOST_PHOENIX_A_ref | |
102 | , Context const & | |
103 | ) | |
104 | >::type | |
105 | operator()(F const & f, BOOST_PHOENIX_A_ref_a, Context const & ctx) const | |
106 | { | |
107 | return boost::phoenix::eval(f, ctx)(BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, PHOENIX_EVAL_ARG, _)); | |
108 | } | |
109 | ||
110 | template <typename F, BOOST_PHOENIX_typename_A, typename Context> | |
111 | typename result< | |
112 | function_eval( | |
113 | F & | |
114 | , BOOST_PHOENIX_A_ref | |
115 | , Context const & | |
116 | ) | |
117 | >::type | |
118 | operator()(F & f, BOOST_PHOENIX_A_ref_a, Context const & ctx) const | |
119 | { | |
120 | return boost::phoenix::eval(f, ctx)(BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, PHOENIX_EVAL_ARG, _)); | |
121 | } | |
122 | #endif | |
123 | ||
124 | #endif |