Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64557 - in sandbox/SOC/2010/phoenix3: boost/phoenix boost/phoenix/scope boost/phoenix/statement libs/phoenix/test/scope
From: thom.heller_at_[hidden]
Date: 2010-08-03 02:17:12


Author: theller
Date: 2010-08-03 02:17:11 EDT (Tue, 03 Aug 2010)
New Revision: 64557
URL: http://svn.boost.org/trac/boost/changeset/64557

Log:
fixed let to work with arbitrary environments
Text files modified:
   sandbox/SOC/2010/phoenix3/boost/phoenix/fusion.hpp | 2 +-
   sandbox/SOC/2010/phoenix3/boost/phoenix/scope/let.hpp | 9 ---------
   sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp | 18 ++++++++++++++++--
   sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/let_tests.cpp | 14 ++++++++++++--
   4 files changed, 29 insertions(+), 14 deletions(-)

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/fusion.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/fusion.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/fusion.hpp 2010-08-03 02:17:11 EDT (Tue, 03 Aug 2010)
@@ -8,6 +8,6 @@
 #ifndef PHOENIX_FUSION_HPP
 #define PHOENIX_FUSION_HPP
 
-#include <boost/phoenix/fusion.hpp>
+#include <boost/phoenix/fusion/at.hpp>
 
 #endif

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/scope/let.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/scope/let.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/scope/let.hpp 2010-08-03 02:17:11 EDT (Tue, 03 Aug 2010)
@@ -74,15 +74,6 @@
         typename make_let<Expr, Vars, Map>::type const
         operator[](Expr const& expr) const
         {
- typedef typename
- fusion::result_of::as_vector<
- typename fusion::result_of::transform<
- Vars
- , detail::initialize_local<fusion::vector1<int&> >
- >::type
- >::type
- locals_type;
-
             return make_let<Expr, Vars, Map>()(expr, vars);
         }
 

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp 2010-08-03 02:17:11 EDT (Tue, 03 Aug 2010)
@@ -60,11 +60,25 @@
 
             template <typename This, typename Expr, typename State>
             struct result<This(Expr, State)>
- : fusion::result_of::push_front<typename remove_const<typename remove_reference<State>::type>::type const, typename remove_const<typename remove_reference<Expr>::type>::type>
+ : fusion::result_of::push_front<
+ typename remove_const<
+ typename remove_reference<State>::type
+ >::type const
+ , typename remove_const<
+ typename remove_reference<Expr>::type
+ >::type
+ >
             {};
 
             template <typename Expr, typename State>
- typename fusion::result_of::push_front<typename remove_const<typename remove_reference<State>::type>::type const, typename remove_const<typename remove_reference<Expr>::type>::type>::type
+ typename fusion::result_of::push_front<
+ typename remove_const<
+ typename remove_reference<State>::type
+ >::type const
+ , typename remove_const<
+ typename remove_reference<Expr>::type
+ >::type
+ >::type
             operator()(Expr expr, State state) const
             {
                 return fusion::push_front(state, expr);

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/let_tests.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/let_tests.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/let_tests.cpp 2010-08-03 02:17:11 EDT (Tue, 03 Aug 2010)
@@ -10,13 +10,14 @@
 #include <vector>
 
 #define PHOENIX_LIMIT 6
-#include <boost/phoenix/core/limits.hpp>
-
 #include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/tuple.hpp>
 #include <boost/phoenix/scope.hpp>
 #include <boost/phoenix/core.hpp>
 #include <boost/phoenix/operator.hpp>
 #include <boost/phoenix/function.hpp>
+#include <boost/phoenix/fusion.hpp>
+
 
 int
 main()
@@ -154,6 +155,15 @@
         BOOST_TEST(&i == &j);
     }
 
+ {
+ using boost::phoenix::at_c;
+
+ boost::fusion::tuple<int, int> t = boost::fusion::make_tuple(0, 1);
+ int i = let(_a = at_c<0>(_1))[_a](t);
+
+ BOOST_TEST( i == 0 );
+ }
+
     return boost::report_errors();
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk