Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62536 - in sandbox/SOC/2010/phoenix3: boost/phoenix/core libs/phoenix
From: joel_at_[hidden]
Date: 2010-06-07 21:28:00


Author: djowel
Date: 2010-06-07 21:27:59 EDT (Mon, 07 Jun 2010)
New Revision: 62536
URL: http://svn.boost.org/trac/boost/changeset/62536

Log:
First shot by Thomas Heller
Removed:
   sandbox/SOC/2010/phoenix3/libs/phoenix/placeholder.txt
Text files modified:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp | 62 +++++++++++++++++++++++++++++++++++----
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp | 21 ++++++++++--
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/domain.hpp | 5 ++
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp | 9 +++++
   4 files changed, 84 insertions(+), 13 deletions(-)

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp 2010-06-07 21:27:59 EDT (Mon, 07 Jun 2010)
@@ -8,8 +8,15 @@
 #ifndef PHOENIX_CORE_ACTOR_HPP
 #define PHOENIX_CORE_ACTOR_HPP
 
-#include <boost/proto/proto.hpp>
+#include <boost/fusion/container/vector/vector10.hpp>
+#include <boost/phoenix/core/actor_result.hpp>
+#include <boost/phoenix/core/domain.hpp>
+#include <boost/phoenix/core/meta_grammar.hpp>
+#include <boost/proto/extends.hpp>
+#include <boost/proto/debug.hpp>
+#include <boost/utility/result_of.hpp>
 
+#include <boost/mpl/void.hpp>
 namespace boost { namespace phoenix
 {
     ////////////////////////////////////////////////////////////////////////////
@@ -17,29 +24,70 @@
     // This class is responsible for full function evaluation. Partial
     // function evaluation involves creating a hierarchy of actor objects.
     ////////////////////////////////////////////////////////////////////////////
- template <class Expr>
+ template <typename Expr>
     struct actor
     {
         BOOST_PROTO_BASIC_EXTENDS(Expr, actor<Expr>, phoenix_domain)
         BOOST_PROTO_EXTENDS_ASSIGN()
         BOOST_PROTO_EXTENDS_SUBSCRIPT()
 
- template <class Sig>
+ template <typename Sig>
         struct result : actor_result<Sig> {};
 
         typedef actor<Expr> actor_type;
 
- template <class A0>
- typename boost::result_of<actor_type(A0 const&)>::type
+ struct dummy {};
+
+ //typename boost::result_of<actor_type()>::type
+ //typename actor_result<actor_type()>::type
+ //typename boost::result_of<eval_grammar(actor_type&, fusion::vector0<>&)>::type
+ void
+ operator()() const
+ {
+ BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
+ fusion::vector0<> args;
+
+ eval(*this, args);
+ //return eval(*this, args);
+ }
+
+ template <typename A0>
+ //typename boost::result_of<actor_type(A0 const&)>::type
+ typename actor_result<actor_type(A0 const&)>::type
+ //typename boost::result_of<eval_grammar(actor_type&, fusion::vector1<A0>&)>::type
         operator()(A0 const& a0) const
         {
             BOOST_PROTO_ASSERT_MATCHES(*this, eval_grammar);
- fusion::vector<A0 const&> args(a0);
+ fusion::vector1<A0 const&> args(a0);
+
+ return eval(*this, args);
+ }
+
+ template <typename A0, typename A1>
+ //typename boost::result_of<actor_type(A0 const&, A1 const&)>::type
+ typename actor_result<actor_type(A0 const&, A1 const&)>::type
+ //typename boost::result_of<eval_grammar(actor_type&, fusion::vector1<A0, A1>&)>::type
+ operator()(A0 const& a0, A1 const& a1) const
+ {
+ BOOST_PROTO_ASSERT_MATCHES(*this, eval_grammar);
+ fusion::vector2<A0 const&, A1 const &> args(a0, a1);
+
+ std::cout << typeid( eval( *this, args ) ).name() << "\n";
+
             return eval(*this, args);
         }
         
         /*... more...*/
     };
-}}
+}
+
+ template<typename Expr>
+ struct result_of<phoenix::actor<Expr>() >
+ {
+ typedef phoenix::actor<Expr> F;
+ typedef typename F::template result<F()>::type type;
+ };
+
+}
 
 #endif

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp 2010-06-07 21:27:59 EDT (Mon, 07 Jun 2010)
@@ -9,19 +9,32 @@
 #define PHOENIX_CORE_ACTOR_RESULT_HPP
 
 #include <boost/phoenix/core/meta_grammar.hpp>
-#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/vector/vector10.hpp>
+#include <boost/utility/result_of.hpp>
+
+#include <boost/mpl/void.hpp>
 
 namespace boost { namespace phoenix
 {
     ////////////////////////////////////////////////////////////////////////////
     // Return type computation
     ////////////////////////////////////////////////////////////////////////////
- template<class Sig>
+ template<typename Sig>
     struct actor_result;
 
- template <template Actor, template A0>
+ template <typename Actor>
+ struct actor_result<Actor()>
+ : boost::result_of<eval_grammar(Actor&, fusion::vector0<>&)>
+ {};
+
+ template <typename Actor, typename A0>
     struct actor_result<Actor(A0)>
- : boost::result_of<eval_grammar(Actor&, fusion::vector<A0>&)>
+ : boost::result_of<eval_grammar(Actor&, fusion::vector1<A0>&)>
+ {};
+
+ template <typename Actor, typename A0, typename A1>
+ struct actor_result<Actor(A0, A1)>
+ : boost::result_of<eval_grammar(Actor&, fusion::vector2<A0, A1>&)>
     {};
     
     /*... more ...*/

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/domain.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/domain.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/domain.hpp 2010-06-07 21:27:59 EDT (Mon, 07 Jun 2010)
@@ -8,7 +8,10 @@
 #ifndef PHOENIX_CORE_DOMAIN_HPP
 #define PHOENIX_CORE_DOMAIN_HPP
 
-#include <boost/proto/proto.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/domain.hpp>
+#include <boost/proto/generate.hpp>
+#include <boost/proto/matches.hpp>
 
 namespace boost { namespace phoenix
 {

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp 2010-06-07 21:27:59 EDT (Mon, 07 Jun 2010)
@@ -8,7 +8,14 @@
 #ifndef PHOENIX_CORE_META_GRAMMAR_HPP
 #define PHOENIX_CORE_META_GRAMMAR_HPP
 
-#include <boost/proto/proto.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/matches.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/tags.hpp>
+#include <boost/proto/transform/arg.hpp>
+#include <boost/proto/transform/default.hpp>
+#include <boost/proto/transform/when.hpp>
 
 namespace boost { namespace phoenix
 {

Deleted: sandbox/SOC/2010/phoenix3/libs/phoenix/placeholder.txt
==============================================================================


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