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); }