#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) #ifndef BOOST_PHOENIX_CORE_DETAIL_FUNCTION_EVAL_HPP #define BOOST_PHOENIX_CORE_DETAIL_FUNCTION_EVAL_HPP #include #include #include #include #include #include #include #include #endif #else #if !BOOST_PHOENIX_IS_ITERATING #ifndef BOOST_PHOENIX_CORE_DETAIL_FUNCTION_EVAL_HPP #define BOOST_PHOENIX_CORE_DETAIL_FUNCTION_EVAL_HPP #include #include #include #include #include #include #include #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/function_eval_" BOOST_PHOENIX_LIMIT_STR ".hpp") #endif /*============================================================================= Copyright (c) 2001-2007 Joel de Guzman Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) #endif BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG( (boost)(phoenix)(detail)(function_eval) , (meta_grammar) (meta_grammar) , BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT) ) namespace boost { namespace phoenix { namespace detail { template T& help_rvalue_deduction(T& x) { return x; } template T const& help_rvalue_deduction(T const& x) { return x; } struct function_eval { template struct result; template struct result { typedef typename remove_reference< typename boost::result_of::type >::type fn; typedef typename boost::result_of::type type; }; template typename result::type operator()(F const & f, Context const & ctx) const { return boost::phoenix::eval(f, ctx)(); } template typename result::type operator()(F & f, Context const & ctx) const { return boost::phoenix::eval(f, ctx)(); } #define PHOENIX_GET_ARG(z, n, data) \ typedef \ typename boost::add_reference< \ typename boost::add_const< \ typename boost::result_of< \ boost::phoenix::evaluator( \ BOOST_PP_CAT(A, n) \ , Context \ ) \ >::type \ >::type \ >::type \ BOOST_PP_CAT(a, n); #define PHOENIX_EVAL_ARG(z, n, data) \ help_rvalue_deduction(boost::phoenix::eval(BOOST_PP_CAT(a, n), ctx)) #define M0(z, n, data) \ typename proto::detail::uncvref::type #define BOOST_PHOENIX_ITERATION_PARAMS \ (3, (1, BOOST_PP_DEC(BOOST_PHOENIX_ACTOR_LIMIT), \ )) #include BOOST_PHOENIX_ITERATE() #undef PHOENIX_GET_ARG #undef PHOENIX_EVAL_ARG #undef M0 }; } template struct default_actions::when : phoenix::call {}; }} #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) #pragma wave option(output: null) #endif #endif #else template < typename This , typename F , BOOST_PHOENIX_typename_A , typename Context > struct result { typedef typename remove_reference< typename boost::result_of::type >::type fn; BOOST_PP_REPEAT(BOOST_PHOENIX_ITERATION, PHOENIX_GET_ARG, _) typedef typename boost::result_of::type type; /* typedef typename mpl::eval_if_c< has_phx2_result< fn , BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, M0, _) >::value , boost::result_of< fn( BOOST_PHOENIX_a ) > , phx2_result< fn , BOOST_PHOENIX_a > >::type type; */ }; template typename result< function_eval( F const & , BOOST_PHOENIX_A_ref , Context const & ) >::type operator()(F const & f, BOOST_PHOENIX_A_ref_a, Context const & ctx) const { return boost::phoenix::eval(f, ctx)(BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, PHOENIX_EVAL_ARG, _)); } template typename result< function_eval( F & , BOOST_PHOENIX_A_ref , Context const & ) >::type operator()(F & f, BOOST_PHOENIX_A_ref_a, Context const & ctx) const { return boost::phoenix::eval(f, ctx)(BOOST_PP_ENUM(BOOST_PHOENIX_ITERATION, PHOENIX_EVAL_ARG, _)); } #endif #endif