From 79ff7fe63433d87f3fd686b645557d95cf0b8f81 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sat, 20 Feb 2016 10:56:27 +0900 Subject: [PATCH] Split inlined implementations into its own header. --- include/boost/phoenix/core/actor.hpp | 84 +--------- .../phoenix/core/detail/cpp03/assign.hpp | 97 +++++++++++ .../core/detail/cpp03/function_equal.hpp | 77 +++++++++ .../core/detail/cpp03/function_eval.hpp | 114 +++++++++++++ .../core/detail/cpp03/function_eval_expr.hpp | 39 +++++ .../phoenix/core/detail/cpp03/phx2_result.hpp | 75 +++++++++ .../cpp03/preprocessed/function_eval_expr.hpp | 25 +++ .../phoenix/core/detail/function_eval.hpp | 158 ++---------------- .../boost/phoenix/core/detail/phx2_result.hpp | 67 +------- include/boost/phoenix/core/function_equal.hpp | 63 +------ 10 files changed, 441 insertions(+), 358 deletions(-) create mode 100644 include/boost/phoenix/core/detail/cpp03/assign.hpp create mode 100644 include/boost/phoenix/core/detail/cpp03/function_equal.hpp create mode 100644 include/boost/phoenix/core/detail/cpp03/function_eval.hpp create mode 100644 include/boost/phoenix/core/detail/cpp03/function_eval_expr.hpp create mode 100644 include/boost/phoenix/core/detail/cpp03/phx2_result.hpp create mode 100644 include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr.hpp diff --git a/include/boost/phoenix/core/actor.hpp b/include/boost/phoenix/core/actor.hpp index bdaf082..7f22e6c 100644 --- a/include/boost/phoenix/core/actor.hpp +++ b/include/boost/phoenix/core/actor.hpp @@ -84,89 +84,7 @@ namespace boost { namespace phoenix } }; - #define BOOST_PHOENIX_ACTOR_ASSIGN_CHILD(N) \ - assign( \ - proto::_child_c \ - , proto::call< \ - proto::_child_c(proto::_state) \ - > \ - ) \ - /**/ - #define BOOST_PHOENIX_ACTOR_START_ASSIGN_CHILD(Z, N, D) \ - proto::and_< \ - BOOST_PHOENIX_ACTOR_ASSIGN_CHILD(N) \ - /**/ - #define BOOST_PHOENIX_ACTOR_END_ASSIGN(Z, N, D) \ - > \ - /**/ - #define BOOST_PHOENIX_ACTOR_ASSIGN_CALL(N) \ - proto::when< \ - proto::nary_expr \ - , BOOST_PP_ENUM( \ - N \ - , BOOST_PHOENIX_ACTOR_START_ASSIGN_CHILD \ - , _ \ - ) \ - BOOST_PP_REPEAT( \ - N \ - , BOOST_PHOENIX_ACTOR_END_ASSIGN \ - , _ \ - ) \ - > \ - /**/ - #define BOOST_PHOENIX_ACTOR_START_ASSIGN_CALL(Z, N, D) \ - proto::or_< \ - BOOST_PHOENIX_ACTOR_ASSIGN_CALL(N) \ - /**/ - -#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) -#include -#else -#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) -#pragma wave option(preserve: 2, line: 0, output: "detail/cpp03/preprocessed/assign_" BOOST_PHOENIX_LIMIT_STR ".hpp") -#endif -/*============================================================================== - Copyright (c) 2005-2010 Joel de Guzman - Copyright (c) 2010-2011 Thomas Heller - - 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 - - struct assign - : BOOST_PP_ENUM_SHIFTED( - BOOST_PHOENIX_LIMIT - , BOOST_PHOENIX_ACTOR_START_ASSIGN_CALL - , _ - ) - , proto::when< - proto::terminal - , do_assign(proto::_, proto::_state) - > - BOOST_PP_REPEAT( - BOOST_PP_DEC(BOOST_PHOENIX_LIMIT) - , BOOST_PHOENIX_ACTOR_END_ASSIGN - , _ - ) - {}; - -#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) -#pragma wave option(output: null) -#endif - -#endif - #undef BOOST_PHOENIX_ACTOR_ASSIGN_CALL - #undef BOOST_PHOENIX_ACTOR_START_ASSIGN_CALL - #undef BOOST_PHOENIX_ACTOR_END_ASSIGN_CALL - #undef BOOST_PHOENIX_ACTOR_ASSIGN_CHILD - #undef BOOST_PHOENIX_ACTOR_START_ASSIGN_CHILD - #undef BOOST_PHOENIX_ACTOR_END_ASSIGN_CHILD + #include } // Bring in the result_of::actor<> diff --git a/include/boost/phoenix/core/detail/cpp03/assign.hpp b/include/boost/phoenix/core/detail/cpp03/assign.hpp new file mode 100644 index 0000000..8b9494a --- /dev/null +++ b/include/boost/phoenix/core/detail/cpp03/assign.hpp @@ -0,0 +1,97 @@ +/*============================================================================= + Copyright (c) 2005-2010 Joel de Guzman + Copyright (c) 2010 Eric Niebler + Copyright (c) 2010 Thomas Heller + Copyright (c) 2014 John Fletcher + + 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) +==============================================================================*/ +#ifndef BOOST_PHOENIX_CORE_ASSIGN_HPP +#define BOOST_PHOENIX_CORE_ASSIGN_HPP + + #define BOOST_PHOENIX_ACTOR_ASSIGN_CHILD(N) \ + assign( \ + proto::_child_c \ + , proto::call< \ + proto::_child_c(proto::_state) \ + > \ + ) \ + /**/ + #define BOOST_PHOENIX_ACTOR_START_ASSIGN_CHILD(Z, N, D) \ + proto::and_< \ + BOOST_PHOENIX_ACTOR_ASSIGN_CHILD(N) \ + /**/ + #define BOOST_PHOENIX_ACTOR_END_ASSIGN(Z, N, D) \ + > \ + /**/ + #define BOOST_PHOENIX_ACTOR_ASSIGN_CALL(N) \ + proto::when< \ + proto::nary_expr \ + , BOOST_PP_ENUM( \ + N \ + , BOOST_PHOENIX_ACTOR_START_ASSIGN_CHILD \ + , _ \ + ) \ + BOOST_PP_REPEAT( \ + N \ + , BOOST_PHOENIX_ACTOR_END_ASSIGN \ + , _ \ + ) \ + > \ + /**/ + #define BOOST_PHOENIX_ACTOR_START_ASSIGN_CALL(Z, N, D) \ + proto::or_< \ + BOOST_PHOENIX_ACTOR_ASSIGN_CALL(N) \ + /**/ + +#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "preprocessed/assign_" BOOST_PHOENIX_LIMIT_STR ".hpp") +#endif +/*============================================================================== + Copyright (c) 2005-2010 Joel de Guzman + Copyright (c) 2010-2011 Thomas Heller + + 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 + + struct assign + : BOOST_PP_ENUM_SHIFTED( + BOOST_PHOENIX_LIMIT + , BOOST_PHOENIX_ACTOR_START_ASSIGN_CALL + , _ + ) + , proto::when< + proto::terminal + , do_assign(proto::_, proto::_state) + > + BOOST_PP_REPEAT( + BOOST_PP_DEC(BOOST_PHOENIX_LIMIT) + , BOOST_PHOENIX_ACTOR_END_ASSIGN + , _ + ) + {}; + +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif + #undef BOOST_PHOENIX_ACTOR_ASSIGN_CALL + #undef BOOST_PHOENIX_ACTOR_START_ASSIGN_CALL + #undef BOOST_PHOENIX_ACTOR_END_ASSIGN_CALL + #undef BOOST_PHOENIX_ACTOR_ASSIGN_CHILD + #undef BOOST_PHOENIX_ACTOR_START_ASSIGN_CHILD + #undef BOOST_PHOENIX_ACTOR_END_ASSIGN_CHILD +#endif + diff --git a/include/boost/phoenix/core/detail/cpp03/function_equal.hpp b/include/boost/phoenix/core/detail/cpp03/function_equal.hpp new file mode 100644 index 0000000..e16769f --- /dev/null +++ b/include/boost/phoenix/core/detail/cpp03/function_equal.hpp @@ -0,0 +1,77 @@ +/*============================================================================== + Copyright (c) 2005-2010 Joel de Guzman + Copyright (c) 2010 Thomas Heller + + 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) +==============================================================================*/ +#ifndef BOOST_PHOENIX_CORE_DETAIL_FUNCTION_EQUAL_HPP +#define BOOST_PHOENIX_CORE_DETAIL_FUNCTION_EQUAL_HPP + +#include +#include + +#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "preprocessed/function_equal_" BOOST_PHOENIX_LIMIT_STR ".hpp") +#endif +/*============================================================================== + Copyright (c) 2001-2010 Joel de Guzman + Copyright (c) 2004 Daniel Wallin + Copyright (c) 2010 Thomas Heller + + 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 + + #define BOOST_PHOENIX_FUNCTION_EQUAL_R(Z, N, DATA) \ + && function_equal_()( \ + proto::child_c< N >(e1) \ + , proto::child_c< N >(e2) \ + ) \ + /**/ + + #define BOOST_PHOENIX_FUNCTION_EQUAL(Z, N, DATA) \ + template \ + result_type \ + evaluate( \ + Expr1 const& e1 \ + , Expr1 const& e2 \ + , mpl::long_< N > \ + ) const \ + { \ + return \ + function_equal_()( \ + proto::child_c<0>(e1) \ + , proto::child_c<0>(e2) \ + ) \ + BOOST_PP_REPEAT_FROM_TO( \ + 1 \ + , N \ + , BOOST_PHOENIX_FUNCTION_EQUAL_R \ + , _ \ + ); \ + } \ + /**/ + + BOOST_PP_REPEAT_FROM_TO( + 1 + , BOOST_PP_INC(BOOST_PROTO_MAX_ARITY) + , BOOST_PHOENIX_FUNCTION_EQUAL + , _ + ) + #undef BOOST_PHOENIX_FUNCTION_EQUAL_R + #undef BOOST_PHOENIX_FUNCTION_EQUAL + +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif +#endif + +#endif + diff --git a/include/boost/phoenix/core/detail/cpp03/function_eval.hpp b/include/boost/phoenix/core/detail/cpp03/function_eval.hpp new file mode 100644 index 0000000..2083366 --- /dev/null +++ b/include/boost/phoenix/core/detail/cpp03/function_eval.hpp @@ -0,0 +1,114 @@ +#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) + +#include + +#else + +#if !BOOST_PHOENIX_IS_ITERATING + +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 1, line: 0, output: "preprocessed/function_eval_" BOOST_PHOENIX_LIMIT_STR ".hpp") +#endif + + #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 + +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#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 diff --git a/include/boost/phoenix/core/detail/cpp03/function_eval_expr.hpp b/include/boost/phoenix/core/detail/cpp03/function_eval_expr.hpp new file mode 100644 index 0000000..ea8af5e --- /dev/null +++ b/include/boost/phoenix/core/detail/cpp03/function_eval_expr.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2016 Kohei Takahashi + + 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) +==============================================================================*/ + +#include + +#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "preprocessed/function_eval_expr_" BOOST_PHOENIX_LIMIT_STR ".hpp") +#endif +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2016 Kohei Takahashi + + 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) +) + +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif diff --git a/include/boost/phoenix/core/detail/cpp03/phx2_result.hpp b/include/boost/phoenix/core/detail/cpp03/phx2_result.hpp new file mode 100644 index 0000000..e5af19d --- /dev/null +++ b/include/boost/phoenix/core/detail/cpp03/phx2_result.hpp @@ -0,0 +1,75 @@ +/*============================================================================= + Copyright (c) 2011 Thomas Heller + + 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 !BOOST_PHOENIX_IS_ITERATING + + template + struct has_phx2_result + : mpl::false_ + {}; + + template + struct phx2_result; + +#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) +#include +#else +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(preserve: 2, line: 0, output: "cpp03/preprocessed/phx2_result_" BOOST_PHOENIX_LIMIT_STR ".hpp") +#endif +/*============================================================================= + Copyright (c) 2011 Thomas Heller + + 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 + + + #define BOOST_PHOENIX_ITERATION_PARAMS \ + (3, (1, BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT), \ + )) +#include BOOST_PHOENIX_ITERATE() + +#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) +#pragma wave option(output: null) +#endif + +#endif + +#else + + template + struct has_phx2_result + : mpl::eval_if< + has_result_type + , mpl::false_ + , has_phx2_result_impl > + >::type + {}; + + + template + struct phx2_result + { + typedef typename F::template result::type type; + }; + + template + struct phx2_result + { + typedef typename F::template result::type type; + }; + + template + struct phx2_result + { + typedef typename F::template result::type type; + }; + +#endif diff --git a/include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr.hpp b/include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr.hpp new file mode 100644 index 0000000..3b7aac3 --- /dev/null +++ b/include/boost/phoenix/core/detail/cpp03/preprocessed/function_eval_expr.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + Copyright (c) 2016 Kohei Takahashi + + 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) +==============================================================================*/ + +#ifndef BOOST_PHOENIX_PREPROCESSED_CORE_DETAIL_FUNCTION_EVAL_EXPR_HPP +#define BOOST_PHOENIX_PREPROCESSED_CORE_DETAIL_FUNCTION_EVAL_EXPR_HPP + +#if BOOST_PHOENIX_LIMIT <= 10 +#include +#elif BOOST_PHOENIX_LIMIT <= 20 +#include +#elif BOOST_PHOENIX_LIMIT <= 30 +#include +#elif BOOST_PHOENIX_LIMIT <= 40 +#include +#elif BOOST_PHOENIX_LIMIT <= 50 +#include +#else +#error "BOOST_PHOENIX_LIMIT out of bounds for preprocessed headers" +#endif + +#endif diff --git a/include/boost/phoenix/core/detail/function_eval.hpp b/include/boost/phoenix/core/detail/function_eval.hpp index 8a47d19..a964419 100644 --- a/include/boost/phoenix/core/detail/function_eval.hpp +++ b/include/boost/phoenix/core/detail/function_eval.hpp @@ -1,37 +1,3 @@ -#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: "cpp03/preprocessed/function_eval_" BOOST_PHOENIX_LIMIT_STR ".hpp") -#endif /*============================================================================= Copyright (c) 2001-2007 Joel de Guzman @@ -39,17 +5,18 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ +#ifndef BOOST_PHOENIX_CORE_DETAIL_FUNCTION_EVAL_HPP +#define BOOST_PHOENIX_CORE_DETAIL_FUNCTION_EVAL_HPP -#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) -#pragma wave option(preserve: 1) -#endif +#include +#include +#include +#include +#include +#include +#include -BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG( - (boost)(phoenix)(detail)(function_eval) - , (meta_grammar) - (meta_grammar) - , BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT) -) +#include namespace boost { namespace phoenix { namespace detail @@ -97,35 +64,7 @@ namespace boost { namespace phoenix { 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 - + #include }; } @@ -136,79 +75,4 @@ namespace boost { namespace phoenix { {}; }} -#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 diff --git a/include/boost/phoenix/core/detail/phx2_result.hpp b/include/boost/phoenix/core/detail/phx2_result.hpp index 748e79e..760f167 100644 --- a/include/boost/phoenix/core/detail/phx2_result.hpp +++ b/include/boost/phoenix/core/detail/phx2_result.hpp @@ -4,7 +4,6 @@ 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 !BOOST_PHOENIX_IS_ITERATING #ifndef BOOST_PHOENIX_CORE_DETAIL_PHX2_RESULT_HPP #define BOOST_PHOENIX_CORE_DETAIL_PHX2_RESULT_HPP #include @@ -33,73 +32,9 @@ namespace boost { namespace phoenix { typedef boost::mpl::bool_ type; }; - template - struct has_phx2_result - : mpl::false_ - {}; - - template - struct phx2_result; -#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) -#include -#else -#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) -#pragma wave option(preserve: 2, line: 0, output: "cpp03/preprocessed/phx2_result_" BOOST_PHOENIX_LIMIT_STR ".hpp") -#endif -/*============================================================================= - Copyright (c) 2011 Thomas Heller - - 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 - - - #define BOOST_PHOENIX_ITERATION_PARAMS \ - (3, (1, BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT), \ - )) -#include BOOST_PHOENIX_ITERATE() - -#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) -#pragma wave option(output: null) -#endif - -#endif + #include } }} #endif -#else - - template - struct has_phx2_result - : mpl::eval_if< - has_result_type - , mpl::false_ - , has_phx2_result_impl > - >::type - {}; - - - template - struct phx2_result - { - typedef typename F::template result::type type; - }; - - template - struct phx2_result - { - typedef typename F::template result::type type; - }; - - template - struct phx2_result - { - typedef typename F::template result::type type; - }; - -#endif diff --git a/include/boost/phoenix/core/function_equal.hpp b/include/boost/phoenix/core/function_equal.hpp index 705b295..ea31ac1 100644 --- a/include/boost/phoenix/core/function_equal.hpp +++ b/include/boost/phoenix/core/function_equal.hpp @@ -8,7 +8,6 @@ #ifndef BOOST_PHOENIX_CORE_FUNCTION_EQUAL_HPP #define BOOST_PHOENIX_CORE_FUNCTION_EQUAL_HPP -#include #include #include #include @@ -103,67 +102,7 @@ namespace boost { namespace phoenix } private: -#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) -#include -#else -#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) -#pragma wave option(preserve: 2, line: 0, output: "detail/cpp03/preprocessed/function_equal_" BOOST_PHOENIX_LIMIT_STR ".hpp") -#endif -/*============================================================================== - Copyright (c) 2001-2010 Joel de Guzman - Copyright (c) 2004 Daniel Wallin - Copyright (c) 2010 Thomas Heller - - 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 - - #define BOOST_PHOENIX_FUNCTION_EQUAL_R(Z, N, DATA) \ - && function_equal_()( \ - proto::child_c< N >(e1) \ - , proto::child_c< N >(e2) \ - ) \ - /**/ - - #define BOOST_PHOENIX_FUNCTION_EQUAL(Z, N, DATA) \ - template \ - result_type \ - evaluate( \ - Expr1 const& e1 \ - , Expr1 const& e2 \ - , mpl::long_< N > \ - ) const \ - { \ - return \ - function_equal_()( \ - proto::child_c<0>(e1) \ - , proto::child_c<0>(e2) \ - ) \ - BOOST_PP_REPEAT_FROM_TO( \ - 1 \ - , N \ - , BOOST_PHOENIX_FUNCTION_EQUAL_R \ - , _ \ - ); \ - } \ - /**/ - - BOOST_PP_REPEAT_FROM_TO( - 1 - , BOOST_PP_INC(BOOST_PROTO_MAX_ARITY) - , BOOST_PHOENIX_FUNCTION_EQUAL - , _ - ) - #undef BOOST_PHOENIX_FUNCTION_EQUAL_R - #undef BOOST_PHOENIX_FUNCTION_EQUAL - -#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) -#pragma wave option(output: null) -#endif -#endif + #include }; }