Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62714 - in sandbox/SOC/2010/phoenix3/boost/phoenix: . core statement
From: joel_at_[hidden]
Date: 2010-06-10 03:35:20


Author: djowel
Date: 2010-06-10 03:35:15 EDT (Thu, 10 Jun 2010)
New Revision: 62714
URL: http://svn.boost.org/trac/boost/changeset/62714

Log:
+ renamed as_actor to compose
+ removed actor template argument to compose
+ added compose_ex which accepts the actor template argument
Added:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/compose.hpp
      - copied, changed from r62711, /sandbox/SOC/2010/phoenix3/boost/phoenix/core/as_actor.hpp
Removed:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/as_actor.hpp
Text files modified:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp | 2 +-
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/argument.hpp | 16 +++++++++++-----
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/compose.hpp | 36 +++++++++++++++++++++++-------------
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/nothing.hpp | 7 ++++---
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp | 12 ++++++------
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp | 8 ++++----
   sandbox/SOC/2010/phoenix3/boost/phoenix/statement/if.hpp | 14 +++++++-------
   7 files changed, 56 insertions(+), 39 deletions(-)

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp 2010-06-10 03:35:15 EDT (Thu, 10 Jun 2010)
@@ -12,7 +12,7 @@
 #include <boost/phoenix/version.hpp>
 #include <boost/phoenix/core/limits.hpp>
 #include <boost/phoenix/core/actor.hpp>
-#include <boost/phoenix/core/as_actor.hpp>
+#include <boost/phoenix/core/compose.hpp>
 #include <boost/phoenix/core/is_actor.hpp>
 #include <boost/phoenix/core/argument.hpp>
 #include <boost/phoenix/core/value.hpp>

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/argument.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/argument.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/argument.hpp 2010-06-10 03:35:15 EDT (Thu, 10 Jun 2010)
@@ -10,7 +10,7 @@
 #define PHOENIX_CORE_ARGUMENT_HPP
 
 #include <boost/phoenix/core/actor.hpp>
-#include <boost/phoenix/core/as_actor.hpp>
+#include <boost/phoenix/core/compose.hpp>
 #include <boost/phoenix/core/meta_grammar.hpp>
 #include <boost/phoenix/core/environment.hpp>
 
@@ -22,8 +22,14 @@
 
 namespace boost { namespace phoenix
 {
- // function for evaluating argument placeholders like: _1
-
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // argument
+ //
+ // function for evaluating argument placeholders like: _1
+ //
+ ////////////////////////////////////////////////////////////////////////////
+
     namespace result_of
     {
         template <typename Env, typename N>
@@ -35,7 +41,7 @@
     
     struct argument
     {
- template <typename Signature>
+ template <typename Sig>
         struct result;
 
         template <typename This, typename Env, typename N>
@@ -52,7 +58,7 @@
     };
     
     template <typename N>
- struct make_argument : boost::phoenix::as_actor<argument, actor, N> {};
+ struct make_argument : boost::phoenix::compose<argument, N> {};
 
     namespace placeholders
     {

Deleted: sandbox/SOC/2010/phoenix3/boost/phoenix/core/as_actor.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/as_actor.hpp 2010-06-10 03:35:15 EDT (Thu, 10 Jun 2010)
+++ (empty file)
@@ -1,170 +0,0 @@
-/*==============================================================================
- Copyright (c) 2001-2010 Joel de Guzman
- Copyright (c) 2010 Eric Niebler
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-==============================================================================*/
-#ifndef PHOENIX_CORE_AS_ACTOR_HPP
-#define PHOENIX_CORE_AS_ACTOR_HPP
-
-#include <boost/call_traits.hpp>
-#include <boost/fusion/sequence/intrinsic/at.hpp>
-#include <boost/phoenix/core/actor.hpp>
-#include <boost/phoenix/core/domain.hpp>
-#include <boost/phoenix/core/meta_grammar.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
-#include <boost/preprocessor/iteration/local.hpp>
-#include <boost/proto/tags.hpp>
-#include <boost/proto/make_expr.hpp>
-
-namespace boost { namespace phoenix
-{
- ////////////////////////////////////////////////////////////////////////////
- // Create an actor (TR1 function) from a proto transform and data type
- // we will associte with it (the actor).
- ////////////////////////////////////////////////////////////////////////////
- template<typename F, template< typename > class Actor
- , typename A0 = void, typename A1 = void, typename A2 = void, typename A3 = void
- /* ... more ... */
- , typename Dummy = void>
- struct as_actor;
-
- template<typename F, template<typename> class Actor>
- struct as_actor<F, Actor>
- {
- typedef
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , funcwrap<F>
- , env>::type
- base_type;
- typedef Actor<base_type> result_type;
- typedef result_type type;
-
- result_type
- operator()() const
- {
- actor<base_type> const e = {{funcwrap<F>(), env()}};
- return e;
- }
- };
-
- template<typename F, template<typename> class Actor, typename A0>
- struct as_actor<F, Actor, A0>
- {
- typedef
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , funcwrap<F>
- , env
- , A0>::type
- base_type;
- typedef Actor<base_type> result_type;
- typedef result_type type;
-
- result_type
- operator()( typename call_traits<A0>::param_type a0 ) const
- {
- actor<base_type> const e = {{funcwrap<F>(), env(), a0}};
- return e;
- }
- };
-
- template<typename F, template<typename> class Actor,
- typename A0, typename A1>
- struct as_actor<F, Actor, A0, A1>
- {
- typedef
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , funcwrap<F>
- , env
- , A0
- , A1>::type
- base_type;
- typedef Actor<base_type> result_type;
- typedef result_type type;
-
- result_type
- operator()(
- typename call_traits<A0>::param_type a0,
- typename call_traits<A1>::param_type a1) const
- {
- actor<base_type> const e = {{funcwrap<F>(), env(), a0, a1}};
- return e;
- }
- };
-
- template <typename F, template<typename> class Actor,
- typename A0, typename A1, typename A2>
- struct as_actor<F, Actor, A0, A1, A2>
- {
- typedef
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , funcwrap<F>
- , env
- , A0
- , A1
- , A2>::type
- base_type;
- typedef Actor<base_type> result_type;
- typedef result_type type;
-
- result_type
- operator()(
- typename call_traits<A0>::param_type a0,
- typename call_traits<A1>::param_type a1,
- typename call_traits<A2>::param_type a2) const
- {
- actor<base_type> const e = {{funcwrap<F>(), env(), a0, a1, a2}};
- return e;
- }
- };
-
-}}
-
-/*
-#define BOOST_PP_LOCAL_MACRO( N ) \
-namespace boost { namespace phoenix \
-{ \
- template<typename F, template<typename> class Actor \
- BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> \
- struct as_actor<F, Actor BOOST_PP_ENUM_TRAILING_PARAMS(N, A)> \
- { \
- typedef \
- typename proto::result_of::make_expr< \
- proto::tag::function \
- , proto::default_domain \
- , funcwrap< F > \
- , env BOOST_PP_ENUM_TRAILING_PARAMS(N, A) \
- >::type \
- base_type; \
- \
- typedef Actor<base_type> result_type; \
- typedef result_type type; \
- \
- result_type \
- operator()( \
- BOOST_PP_ENUM_BINARY_PARAMS(N, \
- typename call_traits< A, >::param_type a)) const \
- { \
- actor<base_type> const e = {{ \
- funcwrap< F >(), env() BOOST_PP_ENUM_TRAILING_PARAMS(N, a) \
- }}; \
- return e; \
- } \
- }; \
-}}
-
-#define BOOST_PP_LOCAL_LIMITS ( 0, 3 )
-#include BOOST_PP_LOCAL_ITERATE()
-*/
-
-#endif

Copied: sandbox/SOC/2010/phoenix3/boost/phoenix/core/compose.hpp (from r62711, /sandbox/SOC/2010/phoenix3/boost/phoenix/core/as_actor.hpp)
==============================================================================
--- /sandbox/SOC/2010/phoenix3/boost/phoenix/core/as_actor.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/compose.hpp 2010-06-10 03:35:15 EDT (Thu, 10 Jun 2010)
@@ -5,8 +5,8 @@
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
-#ifndef PHOENIX_CORE_AS_ACTOR_HPP
-#define PHOENIX_CORE_AS_ACTOR_HPP
+#ifndef PHOENIX_CORE_COMPOSE_HPP
+#define PHOENIX_CORE_COMPOSE_HPP
 
 #include <boost/call_traits.hpp>
 #include <boost/fusion/sequence/intrinsic/at.hpp>
@@ -25,14 +25,24 @@
     // Create an actor (TR1 function) from a proto transform and data type
     // we will associte with it (the actor).
     ////////////////////////////////////////////////////////////////////////////
- template<typename F, template< typename > class Actor
+
+ template <typename Expr>
+ struct actor;
+
+ template <typename F, template< typename > class Actor
         , typename A0 = void, typename A1 = void, typename A2 = void, typename A3 = void
         /* ... more ... */
         , typename Dummy = void>
- struct as_actor;
+ struct compose_ex;
+
+ template <typename F
+ , typename A0 = void, typename A1 = void, typename A2 = void, typename A3 = void
+ /* ... more ... */
+ , typename Dummy = void>
+ struct compose : compose_ex<F, actor, A0, A1, A2, A3 /** ... more ... **/> {};
 
- template<typename F, template<typename> class Actor>
- struct as_actor<F, Actor>
+ template <typename F, template<typename> class Actor>
+ struct compose_ex<F, Actor>
     {
         typedef
             typename proto::result_of::make_expr<
@@ -52,8 +62,8 @@
         }
     };
 
- template<typename F, template<typename> class Actor, typename A0>
- struct as_actor<F, Actor, A0>
+ template <typename F, template<typename> class Actor, typename A0>
+ struct compose_ex<F, Actor, A0>
     {
         typedef
             typename proto::result_of::make_expr<
@@ -74,9 +84,9 @@
         }
     };
 
- template<typename F, template<typename> class Actor,
+ template <typename F, template<typename> class Actor,
         typename A0, typename A1>
- struct as_actor<F, Actor, A0, A1>
+ struct compose_ex<F, Actor, A0, A1>
     {
         typedef
             typename proto::result_of::make_expr<
@@ -102,7 +112,7 @@
 
     template <typename F, template<typename> class Actor,
         typename A0, typename A1, typename A2>
- struct as_actor<F, Actor, A0, A1, A2>
+ struct compose_ex<F, Actor, A0, A1, A2>
     {
         typedef
             typename proto::result_of::make_expr<
@@ -134,9 +144,9 @@
 #define BOOST_PP_LOCAL_MACRO( N ) \
 namespace boost { namespace phoenix \
 { \
- template<typename F, template<typename> class Actor \
+ template <typename F, template<typename> class Actor \
         BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> \
- struct as_actor<F, Actor BOOST_PP_ENUM_TRAILING_PARAMS(N, A)> \
+ struct compose_ex<F, Actor BOOST_PP_ENUM_TRAILING_PARAMS(N, A)> \
     { \
         typedef \
             typename proto::result_of::make_expr< \

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/nothing.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/nothing.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/nothing.hpp 2010-06-10 03:35:15 EDT (Thu, 10 Jun 2010)
@@ -8,7 +8,7 @@
 #define PHOENIX_CORE_NOTHING_HPP
 
 #include <boost/phoenix/core/actor.hpp>
-#include <boost/phoenix/core/as_actor.hpp>
+#include <boost/phoenix/core/compose.hpp>
 
 namespace boost { namespace phoenix
 {
@@ -16,9 +16,10 @@
     //
     // null_actor
     //
- // A actor that does nothing (a "bum", if you will :-).
+ // An actor that does nothing (a "bum", if you will :-).
     //
     ////////////////////////////////////////////////////////////////////////////
+
     struct null_actor
     {
         typedef void result_type;
@@ -29,7 +30,7 @@
         }
     };
 
- as_actor<null_actor, actor>::result_type const nothing = {};
+ compose<null_actor>::result_type const nothing = {};
 }}
 
 #endif

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp 2010-06-10 03:35:15 EDT (Thu, 10 Jun 2010)
@@ -9,7 +9,7 @@
 #define PHOENIX_CORE_REFERENCE_HPP
 
 #include <boost/phoenix/core/actor.hpp>
-#include <boost/phoenix/core/as_actor.hpp>
+#include <boost/phoenix/core/compose.hpp>
 #include <boost/phoenix/core/meta_grammar.hpp>
 #include <boost/utility/result_of.hpp>
 
@@ -23,7 +23,7 @@
     struct reference
     {
         template<typename T>
- struct as_actor : phoenix::as_actor<reference, actor, T &>
+ struct compose : phoenix::compose<reference, T&>
         {};
 
         template<typename Sig>
@@ -43,17 +43,17 @@
     };
 
     template<typename T>
- typename reference::as_actor<T>::result_type
+ typename reference::compose<T>::result_type
     ref(T & t)
     {
- return reference::as_actor<T>()(t);
+ return reference::compose<T>()(t);
     }
 
     template<typename T>
- typename reference::as_actor<T const>::result_type
+ typename reference::compose<T const>::result_type
     cref(T & t)
     {
- return reference::as_actor<T const>()(t);
+ return reference::compose<T const>()(t);
     }
 
 }}

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp 2010-06-10 03:35:15 EDT (Thu, 10 Jun 2010)
@@ -9,7 +9,7 @@
 #define PHOENIX_CORE_VALUE_HPP
 
 #include <boost/phoenix/core/actor.hpp>
-#include <boost/phoenix/core/as_actor.hpp>
+#include <boost/phoenix/core/compose.hpp>
 #include <boost/phoenix/core/meta_grammar.hpp>
 #include <boost/utility/result_of.hpp>
 
@@ -23,7 +23,7 @@
     struct value
     {
         template<typename T>
- struct as_actor : phoenix::as_actor<value, actor, T>
+ struct compose : phoenix::compose<value, T>
         {};
 
         template<typename Sig>
@@ -43,10 +43,10 @@
     };
 
     template<typename T>
- typename value::as_actor<T>::result_type
+ typename value::compose<T>::result_type
     val(T const & t )
     {
- return value::as_actor<T>()(t);
+ return value::compose<T>()(t);
     }
 
 }}

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/if.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/if.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/if.hpp 2010-06-10 03:35:15 EDT (Thu, 10 Jun 2010)
@@ -9,7 +9,7 @@
 #define PHOENIX_STATEMENT_IF_HPP
 
 #include <boost/phoenix/core/actor.hpp>
-#include <boost/phoenix/core/as_actor.hpp>
+#include <boost/phoenix/core/compose.hpp>
 
 #include <boost/phoenix/support/element_at.hpp>
 
@@ -54,7 +54,7 @@
     struct else_gen
     {
         template<typename Else>
- struct as_actor : phoenix::as_actor<if_else_eval, actor, Cond, Then, Else>
+ struct compose : phoenix::compose<if_else_eval, Cond, Then, Else>
         {};
 
         else_gen(Cond const & cond, Then const & then)
@@ -62,10 +62,10 @@
             , then( then ) {}
 
         template<typename Else>
- typename as_actor< Else >::result_type
+ typename compose< Else >::result_type
         operator[](Else const & else_) const
         {
- return as_actor< Else >()(cond, then, else_);
+ return compose< Else >()(cond, then, else_);
         }
 
         Cond const & cond;
@@ -95,17 +95,17 @@
     struct if_gen
     {
         template<typename Then>
- struct as_actor : phoenix::as_actor<if_eval, if_actor, Cond, Then>
+ struct compose : phoenix::compose_ex<if_eval, if_actor, Cond, Then>
         {};
 
         if_gen(Cond const & cond)
             : cond( cond ) {}
 
         template<typename Then>
- typename as_actor<Then>::result_type
+ typename compose<Then>::result_type
         operator[](Then const & then) const
         {
- return as_actor<Then>()(cond, then);
+ return compose<Then>()(cond, then);
         }
 
         Cond const & cond;


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