2
0
mirror of https://github.com/boostorg/phoenix.git synced 2026-02-14 13:02:10 +00:00

fixed compile error on gcc-4.2

[SVN r64152]
This commit is contained in:
Thomas Heller
2010-07-19 10:16:46 +00:00
parent e6ddf62d0c
commit 1717f413df
3 changed files with 14 additions and 8 deletions

View File

@@ -51,9 +51,10 @@ namespace boost { namespace phoenix
template <typename Env, typename N>
typename result_of::argument<Env, N>::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<eval_grammar(N)>::type argument_id;
return get_environment_argument_c<argument_id::value>(env);
}
};

View File

@@ -13,6 +13,7 @@
#include <boost/fusion/include/as_vector.hpp>
#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/scope/scoped_environment.hpp>
#include <boost/phoenix/core/actor.hpp>
#include <boost/phoenix/scope/local_actor.hpp>
#include <boost/phoenix/scope/detail/local_variable.hpp>
#include <boost/phoenix/support/element_at.hpp>

View File

@@ -45,12 +45,16 @@ namespace boost { namespace phoenix
}
// overload get_environment_argument_c to return the correct argument
template <int N, typename Env>
typename boost::enable_if<
is_scoped_environment<Env>
, typename result_of::get_environment_argument<Env, mpl::int_<N> >::type
>::type
get_environment_argument_c(Env& env)
template <int N, typename Env, typename OuterEnv, typename Locals, typename Map>
typename result_of::get_environment_argument<scoped_environment<Env, OuterEnv, Locals, Map>, mpl::int_<N> >::type
get_environment_argument_c(scoped_environment<Env, OuterEnv, Locals, Map>& env)
{
return fusion::at_c<N>(env.env);
}
template <int N, typename Env, typename OuterEnv, typename Locals, typename Map>
typename result_of::get_environment_argument<scoped_environment<Env, OuterEnv, Locals, Map>, mpl::int_<N> >::type
get_environment_argument_c(scoped_environment<Env, OuterEnv, Locals, Map> const& env)
{
return fusion::at_c<N>(env.env);
}