|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63011 - in sandbox/SOC/2010/phoenix3/boost/phoenix: core support
From: joel_at_[hidden]
Date: 2010-06-15 22:46:50
Author: djowel
Date: 2010-06-15 22:46:50 EDT (Tue, 15 Jun 2010)
New Revision: 63011
URL: http://svn.boost.org/trac/boost/changeset/63011
Log:
minor tweaks
Removed:
sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp
Text files modified:
sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp | 54 +++++++++++++++++++++------------------
sandbox/SOC/2010/phoenix3/boost/phoenix/core/environment.hpp | 8 +++++
sandbox/SOC/2010/phoenix3/boost/phoenix/support/element_at.hpp | 4 ++
3 files changed, 40 insertions(+), 26 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-15 22:46:50 EDT (Tue, 15 Jun 2010)
@@ -43,24 +43,38 @@
template <typename Expr>
struct actor<Expr>
{
- typedef typename ::boost::phoenix::actor<Expr>::nullary_result type;
+ static const int arity = result_of::arity<Expr>::type::value;
+
+ typedef typename
+ mpl::eval_if_c<
+ arity == 0 // avoid calling result_of::actor when this is true
+ , boost::result_of<eval_grammar(Expr const&, fusion::vector0<>&)>
+ , mpl::identity<detail::error_expecting_arguments>
+ >::type
+ type;
};
template <typename Expr, typename A0>
struct actor<Expr, A0>
- : boost::result_of<eval_grammar(::boost::phoenix::actor<Expr> const &, fusion::vector1<A0>&)>
+ : boost::result_of<eval_grammar(
+ ::boost::phoenix::actor<Expr> const&, fusion::vector1<A0>&)>
{};
template <typename Expr, typename A0, typename A1>
struct actor<Expr, A0, A1>
- : boost::result_of<eval_grammar(::boost::phoenix::actor<Expr> const &, fusion::vector2<A0, A1>&)>
+ : boost::result_of<eval_grammar(
+ ::boost::phoenix::actor<Expr> const&, fusion::vector2<A0, A1>&)>
{};
}
////////////////////////////////////////////////////////////////////////////
- // The actor class. The main thing! In phoenix, everything is an actor
- // This class is responsible for full function evaluation. Partial
- // function evaluation involves creating a hierarchy of actor objects.
+ //
+ // actor
+ //
+ // The actor class. The main thing! In phoenix, everything is an actor
+ // This class is responsible for full function evaluation. Partial
+ // function evaluation involves creating a hierarchy of actor objects.
+ //
////////////////////////////////////////////////////////////////////////////
template <typename Expr>
struct actor
@@ -69,24 +83,13 @@
BOOST_PROTO_EXTENDS_ASSIGN()
BOOST_PROTO_EXTENDS_SUBSCRIPT()
- static const int arity = result_of::arity<Expr>::type::value;
-
- typedef typename
- mpl::eval_if_c<
- arity == 0 // avoid calling result_of::actor when this is true
- , boost::result_of<eval_grammar(Expr const &, fusion::vector0<>&)>
- , mpl::identity<detail::error_expecting_arguments>
- >::type
- nullary_result;
-
template <typename Sig>
struct result;
template <typename This>
struct result<This()>
- {
- typedef nullary_result type;
- };
+ : result_of::actor<Expr>
+ {};
template <typename This, typename A0>
struct result<This(A0)>
@@ -98,7 +101,7 @@
: result_of::actor<Expr, A0, A1>
{};
- nullary_result
+ typename result_of::actor<Expr>::type
operator()() const
{
BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
@@ -133,11 +136,12 @@
};
}
- template<typename Expr>
- struct result_of<phoenix::actor<Expr>() >
- {
- typedef typename phoenix::actor<Expr>::nullary_result type;
- };
+// $$$ Why is this needed??? $$$
+// template<typename Expr>
+// struct result_of<phoenix::actor<Expr>() >
+// {
+// typedef typename phoenix::actor<Expr>::nullary_result type;
+// };
}
Deleted: sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor_result.hpp 2010-06-15 22:46:50 EDT (Tue, 15 Jun 2010)
+++ (empty file)
@@ -1,43 +0,0 @@
-/*=============================================================================
- Copyright (c) 2005-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_ACTOR_RESULT_HPP
-#define PHOENIX_CORE_ACTOR_RESULT_HPP
-
-#include <boost/phoenix/core/meta_grammar.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 <typename Sig, typename Enable = void>
- struct actor_result;
-
- 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::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 ...*/
-}}
-
-#endif
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/environment.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/environment.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/environment.hpp 2010-06-15 22:46:50 EDT (Tue, 15 Jun 2010)
@@ -8,6 +8,8 @@
#define PHOENIX_CORE_ENVIRONMENT_HPP
#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/fusion/container/vector/vector10.hpp>
+#include <boost/utility/enable_if.hpp>
namespace boost { namespace phoenix
{
@@ -38,6 +40,12 @@
return fusion::at_c<N::value>(env);
}
};
+
+// template <typename Actor, typename Env, typename Enable = void>
+// struct get_signature<Actor, Env,
+// typename enable_if<fusion::traits::is_sequence<T> >::type>
+// {
+// };
}}
#endif
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/support/element_at.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/support/element_at.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/support/element_at.hpp 2010-06-15 22:46:50 EDT (Tue, 15 Jun 2010)
@@ -13,13 +13,15 @@
namespace boost { namespace phoenix
{
-
////////////////////////////////////////////////////////////////////////////
+ //
// Actors carry specific information with it. Primitive actors may hold
// simple primitive data, like values (e.g. int). Composites hold a tuple
// of proto expressions that evaluate to actors (using fusion vector).
// The following facilities extract the "elements" from an actor. An
// element is just a proto expression that evaluates to an actor.
+ //
+ ////////////////////////////////////////////////////////////////////////////
namespace result_of
{
// Get the Nth element value type from Expr (N is an integral constant)
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