From 1717f413dfed4b46e5e93fb5a79eb954259ee7be Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Mon, 19 Jul 2010 10:16:46 +0000 Subject: [PATCH] fixed compile error on gcc-4.2 [SVN r64152] --- include/boost/phoenix/core/argument.hpp | 5 +++-- include/boost/phoenix/scope/lambda.hpp | 1 + .../boost/phoenix/scope/scoped_environment.hpp | 16 ++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/boost/phoenix/core/argument.hpp b/include/boost/phoenix/core/argument.hpp index b9441eb..5cdfc5a 100644 --- a/include/boost/phoenix/core/argument.hpp +++ b/include/boost/phoenix/core/argument.hpp @@ -51,9 +51,10 @@ namespace boost { namespace phoenix template typename result_of::argument::type - operator()(Env& env, N const& n) const + operator()(Env& env, N const&) const { - return get_environment_argument()(env, eval(n)); + typedef typename boost::result_of::type argument_id; + return get_environment_argument_c(env); } }; diff --git a/include/boost/phoenix/scope/lambda.hpp b/include/boost/phoenix/scope/lambda.hpp index 021aa69..7231cb2 100644 --- a/include/boost/phoenix/scope/lambda.hpp +++ b/include/boost/phoenix/scope/lambda.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/phoenix/scope/scoped_environment.hpp b/include/boost/phoenix/scope/scoped_environment.hpp index 1d66d1a..2f62d9d 100644 --- a/include/boost/phoenix/scope/scoped_environment.hpp +++ b/include/boost/phoenix/scope/scoped_environment.hpp @@ -45,12 +45,16 @@ namespace boost { namespace phoenix } // overload get_environment_argument_c to return the correct argument - template - typename boost::enable_if< - is_scoped_environment - , typename result_of::get_environment_argument >::type - >::type - get_environment_argument_c(Env& env) + template + typename result_of::get_environment_argument, mpl::int_ >::type + get_environment_argument_c(scoped_environment& env) + { + return fusion::at_c(env.env); + } + + template + typename result_of::get_environment_argument, mpl::int_ >::type + get_environment_argument_c(scoped_environment const& env) { return fusion::at_c(env.env); }