From 8ecc2cf71bc6268b8fb15b9e3d09a3944e0e2e44 Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Sun, 11 Jan 2015 00:39:52 +0000 Subject: [PATCH] scope/let.hpp Make a local copy of vars and use it. --- include/boost/phoenix/scope/let.hpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/include/boost/phoenix/scope/let.hpp b/include/boost/phoenix/scope/let.hpp index 6899c99..ece33e4 100644 --- a/include/boost/phoenix/scope/let.hpp +++ b/include/boost/phoenix/scope/let.hpp @@ -10,8 +10,8 @@ #ifndef BOOST_PHOENIX_SCOPE_LET_HPP #define BOOST_PHOENIX_SCOPE_LET_HPP -#include -#include +//#include +//#include #include #include #include @@ -88,6 +88,8 @@ namespace boost { namespace phoenix typename result::type const operator()(Vars const & vars, Map, Expr const & expr, Context const & ctx) const { + Vars vars_(vars); + typedef typename proto::detail::uncvref< typename result_of::env::type @@ -111,7 +113,7 @@ namespace boost { namespace phoenix >::type locals_type; - locals_type locals = initialize_locals(proto::value(vars), ctx); + locals_type locals = initialize_locals(proto::value(vars_), ctx); scoped_environment< env_type @@ -123,11 +125,11 @@ namespace boost { namespace phoenix // Fix for bugs (trial) // The idea is to do something which will not be optimised away. - int vsize = boost::fusion::size(vars); - std::stringstream strm; - strm << vsize << std::endl; - int size = strm.str().length(); - BOOST_ASSERT(size >= 0); + //int vsize = boost::fusion::size(vars); + //std::stringstream strm; + //strm << vsize << std::endl; + //int size = strm.str().length(); + //BOOST_ASSERT(size >= 0); return eval(expr, phoenix::context(env, phoenix::actions(ctx))); } };