1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
3 #include <boost/proto/transform/detail/preprocessed/default_function_impl.hpp>
5 #elif !defined(BOOST_PP_IS_ITERATING)
7 #define BOOST_PROTO_DEF_FUN_INVOKE_ARG(Z, M, DATA) \
8 BOOST_PROTO_DEFAULT_EVAL(Z, BOOST_PP_ADD(M, 2), DATA)
10 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
11 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/default_function_impl.hpp")
14 ///////////////////////////////////////////////////////////////////////////////
15 /// \file default_function_impl.hpp
16 /// Contains definition of the default_function_impl, the implementation of the
17 /// _default transform for function-like nodes.
19 // Copyright 2008 Eric Niebler. Distributed under the Boost
20 // Software License, Version 1.0. (See accompanying file
21 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
23 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
24 #pragma wave option(preserve: 1)
27 #define BOOST_PP_ITERATION_PARAMS_1 \
28 (3, (3, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/default_function_impl.hpp>))
29 #include BOOST_PP_ITERATE()
31 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
32 #pragma wave option(output: null)
35 #undef BOOST_PROTO_DEF_FUN_INVOKE_ARG
39 #define N BOOST_PP_ITERATION()
41 template<typename Grammar, typename Expr, typename State, typename Data>
42 struct default_function_impl<Grammar, Expr, State, Data, N>
43 : transform_impl<Expr, State, Data>
45 BOOST_PP_REPEAT(N, BOOST_PROTO_DEFAULT_EVAL_TYPE, Expr)
48 typename proto::detail::result_of_fixup<r0>::type
52 typename BOOST_PROTO_RESULT_OF<
53 function_type(BOOST_PP_ENUM_SHIFTED_PARAMS(N, r))
57 result_type operator ()(
58 typename default_function_impl::expr_param e
59 , typename default_function_impl::state_param s
60 , typename default_function_impl::data_param d
63 return this->invoke(e, s, d, is_member_function_pointer<function_type>());
68 typename default_function_impl::expr_param e
69 , typename default_function_impl::state_param s
70 , typename default_function_impl::data_param d
74 return BOOST_PROTO_DEFAULT_EVAL(~, 0, e)(
75 BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL, e)
80 typename default_function_impl::expr_param e
81 , typename default_function_impl::state_param s
82 , typename default_function_impl::data_param d
86 BOOST_PROTO_USE_GET_POINTER();
87 typedef typename detail::class_member_traits<function_type>::class_type class_type;
89 BOOST_PROTO_GET_POINTER(class_type, (BOOST_PROTO_DEFAULT_EVAL(~, 1, e))) ->*
90 BOOST_PROTO_DEFAULT_EVAL(~, 0, e)
91 )(BOOST_PP_ENUM(BOOST_PP_SUB(N, 2), BOOST_PROTO_DEF_FUN_INVOKE_ARG, e));