Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71921 - in trunk: boost/phoenix/bind/detail boost/phoenix/core boost/phoenix/core/detail boost/phoenix/operator/detail boost/phoenix/stl/algorithm libs/phoenix/example libs/phoenix/test/stdlib
From: thom.heller_at_[hidden]
Date: 2011-05-13 12:47:53


Author: theller
Date: 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
New Revision: 71921
URL: http://svn.boost.org/trac/boost/changeset/71921

Log:
[phoenix]
    
    last minute API simplifications
    

Text files modified:
   trunk/boost/phoenix/bind/detail/member_variable.hpp | 1
   trunk/boost/phoenix/core/detail/expression.hpp | 119 ++++++++++++++++++++++++++++++++++++---
   trunk/boost/phoenix/core/environment.hpp | 104 ++++++++++++++++++++++++++++++++++
   trunk/boost/phoenix/core/meta_grammar.hpp | 26 ++++++++
   trunk/boost/phoenix/operator/detail/define_operator.hpp | 56 ++++++++++++++++++
   trunk/boost/phoenix/operator/detail/undef_operator.hpp | 2
   trunk/boost/phoenix/stl/algorithm/iteration.hpp | 2
   trunk/libs/phoenix/example/invert.cpp | 18 +++--
   trunk/libs/phoenix/example/parallel_for.cpp | 45 ++++++++------
   trunk/libs/phoenix/test/stdlib/cmath.cpp | 2
   10 files changed, 335 insertions(+), 40 deletions(-)

Modified: trunk/boost/phoenix/bind/detail/member_variable.hpp
==============================================================================
--- trunk/boost/phoenix/bind/detail/member_variable.hpp (original)
+++ trunk/boost/phoenix/bind/detail/member_variable.hpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -8,6 +8,7 @@
 #define BOOST_PHOENIX_CORE_DETAIL_MEMBER_VARIABLE_HPP
 
 #include <boost/proto/detail/decltype.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
 
 namespace boost { namespace phoenix { namespace detail {
 

Modified: trunk/boost/phoenix/core/detail/expression.hpp
==============================================================================
--- trunk/boost/phoenix/core/detail/expression.hpp (original)
+++ trunk/boost/phoenix/core/detail/expression.hpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -28,6 +28,8 @@
       , SEQ \
       , BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_DEFAULT \
       , BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_DEFAULT \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_DEFAULT \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_DEFAULT \
       , _ \
     ) \
 /**/
@@ -38,6 +40,8 @@
       , GRAMMAR_SEQ \
       , BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_VARARG \
       , BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_VARARG \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG \
       , LIMIT \
     ) \
 /**/
@@ -47,7 +51,9 @@
         NAME_SEQ \
       , GRAMMAR_SEQ \
       , BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_EXT \
- , BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_VARARG \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_DEFAULT \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_DEFAULT \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_DEFAULT \
       , ACTOR \
     ) \
 /**/
@@ -58,6 +64,8 @@
       , GRAMMAR_SEQ \
       , BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_VARARG_EXT \
       , BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_VARARG \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG \
       , ACTOR \
     ) \
 /**/
@@ -74,7 +82,7 @@
 E :: \
 /**/
 
-#define BOOST_PHOENIX_DEFINE_EXPRESSION_BASE(NAME_SEQ, GRAMMAR_SEQ, EXPRESSION, RULE, DATA) \
+#define BOOST_PHOENIX_DEFINE_EXPRESSION_BASE(NAME_SEQ, GRAMMAR_SEQ, EXPRESSION, RULE, RESULT_OF_MAKE, MAKE_EXPRESSION, DATA) \
 BOOST_PP_SEQ_FOR_EACH( \
     BOOST_PHOENIX_DEFINE_EXPRESSION_NAMESPACE \
   , _ \
@@ -97,6 +105,13 @@
     namespace expression \
     { \
         EXPRESSION(NAME_SEQ, GRAMMAR_SEQ, DATA) \
+ } \
+ namespace rule \
+ { \
+ RULE(NAME_SEQ, GRAMMAR_SEQ, DATA) \
+ } \
+ namespace functional \
+ { \
         typedef \
             boost::proto::functional::make_expr< \
                     tag:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
@@ -106,10 +121,12 @@
               , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
             ); \
     } \
- namespace rule \
+ namespace result_of \
     { \
- RULE(NAME_SEQ, GRAMMAR_SEQ, DATA) \
+ RESULT_OF_MAKE(NAME_SEQ, GRAMMAR_SEQ, DATA) \
     } \
+ MAKE_EXPRESSION(NAME_SEQ, GRAMMAR_SEQ, DATA) \
+ \
 BOOST_PP_SEQ_FOR_EACH( \
     BOOST_PHOENIX_DEFINE_EXPRESSION_NAMESPACE_END \
   , _ \
@@ -152,10 +169,49 @@
 /**/
         
 #define BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_DEFAULT(NAME_SEQ, GRAMMAR_SEQ, D) \
-struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
- : expression:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
- <BOOST_PP_SEQ_ENUM(GRAMMAR_SEQ)> \
- {}; \
+ struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ : expression:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ <BOOST_PP_SEQ_ENUM(GRAMMAR_SEQ)> \
+ {}; \
+/**/
+
+#define BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_DEFAULT(NAME_SEQ, GRAMMAR_SEQ, D) \
+ template <BOOST_PHOENIX_typename_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))> \
+ struct BOOST_PP_CAT(make_, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))) \
+ : boost::result_of< \
+ functional:: \
+ BOOST_PP_CAT( \
+ make_ \
+ , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ )(BOOST_PHOENIX_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))) \
+ > \
+ {}; \
+/**/
+
+#define BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_DEFAULT(NAME_SEQ, GRAMMAR_SEQ, D) \
+ template <BOOST_PHOENIX_typename_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))> \
+ typename \
+ result_of::BOOST_PP_CAT( \
+ make_ \
+ , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ )< \
+ BOOST_PHOENIX_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ)) \
+ >::type const \
+ inline BOOST_PP_CAT( \
+ make_ \
+ , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ )( \
+ BOOST_PHOENIX_A_const_ref_a(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ)) \
+ ) \
+ { \
+ return \
+ functional::BOOST_PP_CAT( \
+ make_ \
+ , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ )()( \
+ BOOST_PHOENIX_a(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ)) \
+ ); \
+ } \
 /**/
 
 #define BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG_R(_, N, NAME) \
@@ -216,7 +272,7 @@
                     ) \
                 )() \
                 BOOST_PP_COMMA_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))) \
- proto::vararg< \
+ boost::proto::vararg< \
                     BOOST_PP_SEQ_ELEM( \
                         BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ)) \
                       , GRAMMAR_SEQ \
@@ -225,6 +281,51 @@
> \
         {}; \
 /**/
+
+#define BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG_R(Z, N, NAME) \
+ template <BOOST_PHOENIX_typename_A(N)> \
+ struct BOOST_PP_CAT(make_, NAME) <BOOST_PHOENIX_A(N)> \
+ : boost::result_of< \
+ functional:: BOOST_PP_CAT(make_, NAME)( \
+ BOOST_PHOENIX_A(N) \
+ ) \
+ > \
+ {}; \
+/**/
+
+#define BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG(NAME_SEQ, GRAMMAR_SEQ, LIMIT) \
+ template <BOOST_PHOENIX_typename_A_void(LIMIT), typename Dummy = void> \
+ struct BOOST_PP_CAT( \
+ make_ \
+ , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ ); \
+ BOOST_PP_REPEAT_FROM_TO( \
+ 1 \
+ , LIMIT \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG_R \
+ , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ ) \
+/**/
+
+#define BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG_R(Z, N, NAME) \
+ template <BOOST_PHOENIX_typename_A(N)> \
+ typename \
+ result_of:: BOOST_PP_CAT(make_, NAME)< \
+ BOOST_PHOENIX_A(N) \
+ >::type \
+ inline BOOST_PP_CAT(make_, NAME)(BOOST_PHOENIX_A_const_ref_a(N)) \
+ { \
+ return functional::BOOST_PP_CAT(make_, NAME)()(BOOST_PHOENIX_a(N)); \
+ } \
+
+#define BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG(NAME_SEQ, GRAMMAR_SEQ, LIMIT) \
+ BOOST_PP_REPEAT_FROM_TO( \
+ 1 \
+ , LIMIT \
+ , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG_R \
+ , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ ) \
+/**/
 
 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_EXT(NAME_SEQ, GRAMMAR_SEQ, ACTOR) \
         template <BOOST_PHOENIX_typename_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))> \

Modified: trunk/boost/phoenix/core/environment.hpp
==============================================================================
--- trunk/boost/phoenix/core/environment.hpp (original)
+++ trunk/boost/phoenix/core/environment.hpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -20,6 +20,8 @@
 
 namespace boost { namespace phoenix
 {
+ struct unused {};
+
     namespace result_of
     {
         template <typename Env, typename Actions>
@@ -27,6 +29,11 @@
         {
             typedef vector2<Env, Actions> type;
         };
+
+ template <typename Env, typename Actions>
+ struct make_context
+ : context<Env, Actions>
+ {};
 
         template <typename Context>
         struct env
@@ -113,6 +120,10 @@
             }
         };
 
+ struct make_context
+ : context
+ {};
+
         struct env
         {
             BOOST_PROTO_CALLABLE()
@@ -209,12 +220,26 @@
     }
 
     template <typename Env, typename Actions>
+ typename result_of::context<Env const &, Actions const&>::type const
+ inline make_context(Env const& env, Actions const& actions)
+ {
+ return context(env, actions);
+ }
+
+ template <typename Env, typename Actions>
     typename result_of::context<Env &, Actions const&>::type const
     inline context(Env & env, Actions const& actions)
     {
         vector2<Env &, Actions const &> e = {env, actions};
         return e;
     }
+
+ template <typename Env, typename Actions>
+ typename result_of::context<Env &, Actions const&>::type const
+ inline make_context(Env & env, Actions const& actions)
+ {
+ return context(env, actions);
+ }
 
     template <typename Env, typename Actions>
     typename result_of::context<Env const &, Actions &>::type const
@@ -225,12 +250,26 @@
     }
     
     template <typename Env, typename Actions>
+ typename result_of::context<Env const &, Actions &>::type const
+ inline make_context(Env const& env, Actions & actions)
+ {
+ return context(env, actions);
+ }
+
+ template <typename Env, typename Actions>
     typename result_of::context<Env &, Actions &>::type const
     inline context(Env & env, Actions & actions)
     {
         vector2<Env &, Actions &> e = {env, actions};
         return e;
     }
+
+ template <typename Env, typename Actions>
+ typename result_of::context<Env &, Actions &>::type const
+ inline make_context(Env & env, Actions & actions)
+ {
+ return context(env, actions);
+ }
 
     struct _env
         : proto::transform<_env>
@@ -273,6 +312,11 @@
             }
     };
 
+ template <typename Expr, typename State>
+ struct _env::impl<Expr, State, unused>
+ : _env::impl<Expr, State, int>
+ {};
+
     template <typename Context>
     typename fusion::result_of::at_c<Context, 0>::type
     inline env(Context & ctx)
@@ -328,6 +372,11 @@
             }
     };
 
+ template <typename Expr, typename State>
+ struct _actions::impl<Expr, State, unused>
+ : _actions::impl<Expr, State, int>
+ {};
+
     template <typename Context>
     typename fusion::result_of::at_c<Context, 1>::type
     inline actions(Context & ctx)
@@ -342,6 +391,61 @@
         return fusion::at_c<1>(ctx);
     }
 
+ namespace result_of
+ {
+ template <
+ BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
+ BOOST_PHOENIX_LIMIT
+ , typename A
+ , mpl::void_
+ )
+ , typename Dummy = void
+ >
+ struct make_env;
+
+ #define BOOST_PHOENIX_M0(Z, N, D) \
+ template <BOOST_PHOENIX_typename_A(N)> \
+ struct make_env<BOOST_PHOENIX_A(N)> \
+ { \
+ typedef BOOST_PP_CAT(vector, N)<BOOST_PHOENIX_A(N)> type; \
+ }; \
+ /**/
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_PHOENIX_LIMIT, BOOST_PHOENIX_M0, _)
+ #undef BOOST_PHOENIX_M0
+ }
+
+ result_of::make_env<>::type
+ inline make_env()
+ {
+ return result_of::make_env<>::type();
+ }
+#define BOOST_PHOENIX_M0(Z, N, D) \
+ template <BOOST_PHOENIX_typename_A(N)> \
+ typename result_of::make_env<BOOST_PHOENIX_A_ref(N)>::type \
+ inline make_env(BOOST_PHOENIX_A_ref_a(N)) \
+ { \
+ typename result_of::make_env<BOOST_PHOENIX_A_ref(N)>::type \
+ env = \
+ { \
+ BOOST_PHOENIX_a(N) \
+ }; \
+ return env; \
+ }; \
+ template <BOOST_PHOENIX_typename_A(N)> \
+ typename result_of::make_env<BOOST_PHOENIX_A_const_ref(N)>::type \
+ inline make_env(BOOST_PHOENIX_A_const_ref_a(N)) \
+ { \
+ typename result_of::make_env<BOOST_PHOENIX_A_const_ref(N)>::type \
+ env = \
+ { \
+ BOOST_PHOENIX_a(N) \
+ }; \
+ return env; \
+ }; \
+ /**/
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_PHOENIX_LIMIT, BOOST_PHOENIX_M0, _)
+ #undef BOOST_PHOENIX_M0
+
     template <typename T, typename Enable = void>
     struct is_environment : fusion::traits::is_sequence<T> {};
 }}

Modified: trunk/boost/phoenix/core/meta_grammar.hpp
==============================================================================
--- trunk/boost/phoenix/core/meta_grammar.hpp (original)
+++ trunk/boost/phoenix/core/meta_grammar.hpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -74,8 +74,32 @@
                 return what()(e, env(s), actions(s));
             }
         };
+
+ template <typename Expr, typename State>
+ struct impl<Expr, State, unused>
+ : proto::transform_impl<Expr, State, unused>
+ {
+ typedef
+ meta_grammar::impl<
+ Expr
+ , typename result_of::env<State>::type
+ , typename result_of::actions<State>::type
+ >
+ what;
+
+ typedef typename what::result_type result_type;
+
+ result_type operator()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param
+ ) const
+ {
+ return what()(e, env(s), actions(s));
+ }
+ };
     };
-
+
     /////////////////////////////////////////////////////////////////////////////
     // Set of default actions. Extend this whenever you add a new phoenix
     // construct

Modified: trunk/boost/phoenix/operator/detail/define_operator.hpp
==============================================================================
--- trunk/boost/phoenix/operator/detail/define_operator.hpp (original)
+++ trunk/boost/phoenix/operator/detail/define_operator.hpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -25,12 +25,37 @@
     {}; \
 /**/
 
+#define BOOST_PHOENIX_UNARY_FUNCTIONAL(__, ___, name) \
+ namespace functional \
+ { \
+ typedef \
+ proto::functional::make_expr<proto::tag::name> \
+ BOOST_PP_CAT(make_, name); \
+ } \
+ namespace result_of \
+ { \
+ template <typename Operand> \
+ struct BOOST_PP_CAT(make_, name) \
+ : boost::result_of< \
+ functional:: BOOST_PP_CAT(make_, name)( \
+ Operand \
+ ) \
+ > \
+ {}; \
+ } \
+ template <typename Operand> \
+ typename result_of::BOOST_PP_CAT(make_, name)<Operand>::type \
+ inline BOOST_PP_CAT(make_, name)(Operand const & operand) \
+ { \
+ return functional::BOOST_PP_CAT(make_, name)()(operand); \
+ } \
+/**/
+
 #define BOOST_PHOENIX_BINARY_EXPRESSION(__, ___, name) \
     template <typename Lhs, typename Rhs> \
     struct name \
         : expr<proto::tag::name, Lhs, Rhs> \
     {}; \
- typedef proto::functional::make_expr<proto::tag::name> BOOST_PP_CAT(make_, name); \
 /**/
 
 #define BOOST_PHOENIX_BINARY_RULE(__, ___, name) \
@@ -39,6 +64,32 @@
     {}; \
 /**/
 
+#define BOOST_PHOENIX_BINARY_FUNCTIONAL(__, ___, name) \
+ namespace functional \
+ { \
+ typedef \
+ proto::functional::make_expr<proto::tag::name> \
+ BOOST_PP_CAT(make_, name); \
+ } \
+ namespace result_of \
+ { \
+ template <typename Lhs, typename Rhs> \
+ struct BOOST_PP_CAT(make_, name) \
+ : boost::result_of< \
+ functional:: BOOST_PP_CAT(make_, name)( \
+ Lhs, Rhs \
+ ) \
+ > \
+ {}; \
+ } \
+ template <typename Rhs, typename Lhs> \
+ typename result_of::BOOST_PP_CAT(make_, name)<Rhs, Lhs>::type \
+ inline BOOST_PP_CAT(make_, name)(Lhs const & lhs, Rhs const & rhs) \
+ { \
+ return functional::BOOST_PP_CAT(make_, name)()(lhs, rhs); \
+ } \
+/**/
+
 #define BOOST_PHOENIX_GRAMMAR(_, __, name) \
     template <typename Dummy> \
     struct meta_grammar::case_<proto::tag::name, Dummy> \
@@ -54,8 +105,10 @@
         BOOST_PP_SEQ_FOR_EACH(BOOST_PHOENIX_UNARY_RULE, _, ops) \
     } \
     BOOST_PP_SEQ_FOR_EACH(BOOST_PHOENIX_GRAMMAR, _, ops) \
+ BOOST_PP_SEQ_FOR_EACH(BOOST_PHOENIX_UNARY_FUNCTIONAL, _, ops) \
 /**/
 
+
 #define BOOST_PHOENIX_BINARY_OPERATORS(ops) \
     namespace expression { \
         BOOST_PP_SEQ_FOR_EACH(BOOST_PHOENIX_BINARY_EXPRESSION, _, ops) \
@@ -64,6 +117,7 @@
         BOOST_PP_SEQ_FOR_EACH(BOOST_PHOENIX_BINARY_RULE, _, ops) \
     } \
     BOOST_PP_SEQ_FOR_EACH(BOOST_PHOENIX_GRAMMAR, _, ops) \
+ BOOST_PP_SEQ_FOR_EACH(BOOST_PHOENIX_BINARY_FUNCTIONAL, _, ops) \
 /**/
 
 #endif

Modified: trunk/boost/phoenix/operator/detail/undef_operator.hpp
==============================================================================
--- trunk/boost/phoenix/operator/detail/undef_operator.hpp (original)
+++ trunk/boost/phoenix/operator/detail/undef_operator.hpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -6,7 +6,9 @@
 ==============================================================================*/
 
 #undef BOOST_PHOENIX_UNARY_RULE
+#undef BOOST_PHOENIX_UNARY_FUNCTIONAL
 #undef BOOST_PHOENIX_BINARY_RULE
+#undef BOOST_PHOENIX_BINARY_FUNCTIONAL
 #undef BOOST_PHOENIX_UNARY_EXPRESSION
 #undef BOOST_PHOENIX_BINARY_EXPRESSION
 #undef BOOST_PHOENIX_GRAMMAR

Modified: trunk/boost/phoenix/stl/algorithm/iteration.hpp
==============================================================================
--- trunk/boost/phoenix/stl/algorithm/iteration.hpp (original)
+++ trunk/boost/phoenix/stl/algorithm/iteration.hpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -39,7 +39,7 @@
             };
 
             template<class R, class F>
- F const & operator()(R& r, F const& fn) const
+ F const operator()(R& r, F const& fn) const
             {
                 return std::for_each(detail::begin_(r), detail::end_(r), fn);
             }

Modified: trunk/libs/phoenix/example/invert.cpp
==============================================================================
--- trunk/libs/phoenix/example/invert.cpp (original)
+++ trunk/libs/phoenix/example/invert.cpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -32,7 +32,7 @@
 template <>
 struct invert_actions::when<phoenix::rule::plus>
     : proto::call<
- phoenix::expression::make_minus(
+ phoenix::functional::make_minus(
             evaluator(proto::_left, phoenix::_context)
           , evaluator(proto::_right, phoenix::_context)
         )
@@ -42,7 +42,7 @@
 template <>
 struct invert_actions::when<phoenix::rule::minus>
     : proto::call<
- phoenix::expression::make_plus(
+ phoenix::functional::make_plus(
             evaluator(proto::_left, phoenix::_context)
           , evaluator(proto::_right, phoenix::_context)
         )
@@ -52,7 +52,7 @@
 template <>
 struct invert_actions::when<phoenix::rule::multiplies>
     : proto::call<
- phoenix::expression::make_divides(
+ phoenix::functional::make_divides(
             evaluator(proto::_left, phoenix::_context)
           , evaluator(proto::_right, phoenix::_context)
         )
@@ -62,7 +62,7 @@
 template <>
 struct invert_actions::when<phoenix::rule::divides>
     : proto::call<
- phoenix::expression::make_multiplies(
+ phoenix::functional::make_multiplies(
             evaluator(proto::_left, phoenix::_context)
           , evaluator(proto::_right, phoenix::_context)
         )
@@ -95,15 +95,18 @@
 typename
     boost::phoenix::result_of::eval<
         Expr const&
- , phoenix::result_of::context<phoenix::nothing_type, invert_actions>::type
+ , phoenix::result_of::make_context<
+ phoenix::result_of::make_env<>::type
+ , invert_actions
+ >::type
>::type
 invert(Expr const & expr)
 {
     return
         phoenix::eval(
             expr
- , phoenix::context(
- phoenix::nothing
+ , phoenix::make_context(
+ phoenix::make_env()
               , invert_actions()
             )
         );
@@ -128,4 +131,3 @@
     print_expr(_1 * invert(_2 - _3));
 }
 
-

Modified: trunk/libs/phoenix/example/parallel_for.cpp
==============================================================================
--- trunk/libs/phoenix/example/parallel_for.cpp (original)
+++ trunk/libs/phoenix/example/parallel_for.cpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -53,13 +53,10 @@
         : init(init), cond(cond), step(step) {}
     
     template <typename Do>
- typename
- boost::result_of<
- expression::make_omp_for(Init, Cond, Step, Do)
- >::type const
+ typename result_of::make_omp_for<Init, Cond, Step, Do>::type const
     operator[](Do const& do_) const
     {
- return expression::make_omp_for()(init, cond, step, do_);
+ return make_omp_for(init, cond, step, do_);
     }
     
     Init init;
@@ -95,19 +92,29 @@
 
 // Doing the same as actor<Expr>::operator
 template <typename Expr, typename A0, typename A1, typename A2>
-typename boost::result_of<
- boost::phoenix::evaluator(
- Expr const &
- , typename boost::phoenix::result_of::context<
- boost::phoenix::vector4<Expr const *, A0 &, A1 &, A2 &>
- , parallel_actions
+typename boost::phoenix::result_of::eval<
+ Expr const &
+ , typename boost::phoenix::result_of::make_context<
+ typename boost::phoenix::result_of::make_env<
+ Expr const *
+ , A0 &
+ , A1 &
+ , A2 &
>::type
- )
+ , parallel_actions
+ >::type
>::type
-parallel_eval(Expr const & expr, A0 & a0, A1 & a1, A2 & a2)
+parallel_eval(Expr & expr, A0 & a0, A1 & a1, A2 & a2)
 {
- boost::phoenix::vector4<Expr const *, A0 &, A1 &, A2 &> env = {boost::addressof(expr), a0, a1, a2};
- return boost::phoenix::eval(expr, boost::phoenix::context(env, parallel_actions()));
+ Expr const * this_ = boost::addressof(expr);
+ return
+ boost::phoenix::eval(
+ expr
+ , boost::phoenix::make_context(
+ boost::phoenix::make_env(this_, a0, a1, a2)
+ , parallel_actions()
+ )
+ );
 }
 
 // changing evaluation mechanism on the fly
@@ -123,21 +130,21 @@
         : proto::call<
             evaluator(
                 proto::_child0
- , functional::context(
+ , functional::make_context(
                     _env
                   , parallel_actions()
                 )
- , int()
+ , unused()//mpl::void_()
             )
>
     {};
 }}
 
 template <typename Expr>
-typename expression::parallel<Expr>::type const
+typename result_of::make_parallel<Expr>::type
 parallel(Expr const & expr)
 {
- return expression::parallel<Expr>::make(expr);
+ return make_parallel(expr);
 }
 ////////////////////////////////////////////////////////////////////////////////
 

Modified: trunk/libs/phoenix/test/stdlib/cmath.cpp
==============================================================================
--- trunk/libs/phoenix/test/stdlib/cmath.cpp (original)
+++ trunk/libs/phoenix/test/stdlib/cmath.cpp 2011-05-13 12:47:51 EDT (Fri, 13 May 2011)
@@ -2,7 +2,7 @@
 #include <boost/function.hpp>
 #include <boost/phoenix/core.hpp>
 #include <boost/phoenix/operator.hpp>
-#include <boost/phoenix/stdlib/cmath.hpp>
+#include <boost/phoenix/stl/cmath.hpp>
 #include <boost/detail/lightweight_test.hpp>
 
 int main()


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