|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68731 - in sandbox/SOC/2010/phoenix3: boost/phoenix/core boost/phoenix/core/detail boost/phoenix/function boost/phoenix/object boost/phoenix/object/detail boost/phoenix/operator boost/phoenix/operator/detail boost/phoenix/scope boost/phoenix/scope/detail boost/phoenix/statement boost/phoenix/statement/detail libs/phoenix/test libs/phoenix/test/include/core
From: thom.heller_at_[hidden]
Date: 2011-02-08 14:02:26
Author: theller
Date: 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
New Revision: 68731
URL: http://svn.boost.org/trac/boost/changeset/68731
Log:
improved compile times a bit, added proto call abstraction
Added:
sandbox/SOC/2010/phoenix3/libs/phoenix/test/include/core/call.cpp (contents, props changed)
Text files modified:
sandbox/SOC/2010/phoenix3/boost/phoenix/core/call.hpp | 16 ++-
sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_result_of.hpp | 12 +-
sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/call.hpp | 4
sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/expression.hpp | 13 ++
sandbox/SOC/2010/phoenix3/boost/phoenix/core/environment.hpp | 41 ++++++++++
sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp | 2
sandbox/SOC/2010/phoenix3/boost/phoenix/core/nothing.hpp | 46 ++++++-----
sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp | 9 +-
sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal.hpp | 22 +++--
sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal_fwd.hpp | 4
sandbox/SOC/2010/phoenix3/boost/phoenix/function/function.hpp | 2
sandbox/SOC/2010/phoenix3/boost/phoenix/object/const_cast.hpp | 29 ++++---
sandbox/SOC/2010/phoenix3/boost/phoenix/object/construct.hpp | 55 ++++----------
sandbox/SOC/2010/phoenix3/boost/phoenix/object/delete.hpp | 1
sandbox/SOC/2010/phoenix3/boost/phoenix/object/detail/construct_eval.hpp | 19 +++-
sandbox/SOC/2010/phoenix3/boost/phoenix/object/detail/target.hpp | 24 ++++++
sandbox/SOC/2010/phoenix3/boost/phoenix/object/dynamic_cast.hpp | 29 ++++---
sandbox/SOC/2010/phoenix3/boost/phoenix/object/new.hpp | 9 +-
sandbox/SOC/2010/phoenix3/boost/phoenix/object/reinterpret_cast.hpp | 27 ++++--
sandbox/SOC/2010/phoenix3/boost/phoenix/object/static_cast.hpp | 26 ++++--
sandbox/SOC/2010/phoenix3/boost/phoenix/operator/detail/define_operator.hpp | 2
sandbox/SOC/2010/phoenix3/boost/phoenix/operator/if_else.hpp | 2
sandbox/SOC/2010/phoenix3/boost/phoenix/operator/member.hpp | 26 -------
sandbox/SOC/2010/phoenix3/boost/phoenix/scope/detail/local_var_def.hpp | 25 +++++-
sandbox/SOC/2010/phoenix3/boost/phoenix/scope/lambda.hpp | 127 +++++++++-------------------------
sandbox/SOC/2010/phoenix3/boost/phoenix/scope/let.hpp | 26 ++----
sandbox/SOC/2010/phoenix3/boost/phoenix/scope/local_variable.hpp | 37 ++++-----
sandbox/SOC/2010/phoenix3/boost/phoenix/scope/scoped_environment.hpp | 21 ++++
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/detail/switch.hpp | 69 +++++++++++------
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/do_while.hpp | 14 --
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/for.hpp | 13 --
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/if.hpp | 23 +----
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/sequence.hpp | 2
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp | 148 +++++++++++++++++++--------------------
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/throw.hpp | 68 ++++++++++-------
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/try_catch.hpp | 35 +--------
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/while.hpp | 11 --
sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile | 20 ++--
38 files changed, 525 insertions(+), 534 deletions(-)
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/call.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/call.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/call.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -8,6 +8,12 @@
#ifndef PHOENIX_CORE_CALL_HPP
#define PHOENIX_CORE_CALL_HPP
+#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/environment.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/transform/impl.hpp>
+
namespace boost { namespace phoenix
{
namespace detail
@@ -16,7 +22,7 @@
struct call_impl;
}
- template <typename Fun>
+ template <typename Fun, typename Dummy = void>
struct call
: proto::transform<call<Fun> >
{
@@ -29,15 +35,11 @@
#include <boost/phoenix/core/detail/call.hpp>
}
-
namespace proto
{
- template <typename Fun>
- struct is_callable<phoenix::call<Fun> > : mpl::true_ {};
+ template <typename Fun, typename Dummy>
+ struct is_callable<phoenix::call<Fun, Dummy> > : mpl::true_ {};
}
-
}
-
-
#endif
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_result_of.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_result_of.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_result_of.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -1,4 +1,5 @@
+/*
#if !defined(PHOENIX_DONT_USE_PREPROCESSED_FILES)
#ifndef PHOENIX_CORE_DETAIL_ACTOR_RESULT_OF_HPP
#define PHOENIX_CORE_DETAIL_ACTOR_RESULT_OF_HPP
@@ -9,6 +10,7 @@
#endif
#else
+*/
#if !PHOENIX_IS_ITERATING
@@ -47,9 +49,9 @@
typename evaluator::impl<
Expr const&
, fusion::vector2<
- fusion::vector1<const ::boost::phoenix::actor<Expr> *>
+ fusion::vector1<const ::boost::phoenix::actor<Expr> *> &
, default_actions
- >
+ > const &
, int
>::result_type
type;
@@ -94,9 +96,9 @@
BOOST_PP_CAT(
fusion::vector
, BOOST_PP_INC(PHOENIX_ITERATION)
- )<const ::boost::phoenix::actor<Expr> *, PHOENIX_A>
+ )<const ::boost::phoenix::actor<Expr> *, PHOENIX_A> &
, default_actions
- >
+ > const &
, int
>::result_type
type;
@@ -104,4 +106,4 @@
#endif
-#endif // PHOENIX_DONT_USE_PREPROCESSED_FILES
+//#endif // PHOENIX_DONT_USE_PREPROCESSED_FILES
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/call.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/call.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/call.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -13,7 +13,7 @@
#define PHOENIX_CORE_DETAIL_CALL_HPP
#if defined(__WAVE__) && defined(PHOENIX_CREATE_PREPROCESSED_FILES)
-#pragma wave option(preserve: 2, line: 0, output: "preprocessed/construct_eval_" PHOENIX_LIMIT_STR ".hpp")
+#pragma wave option(preserve: 2, line: 0, output: "preprocessed/call_" PHOENIX_LIMIT_STR ".hpp")
#endif
/*==============================================================================
@@ -24,6 +24,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
+#include <boost/phoenix/support/iterate.hpp>
+
#if defined(__WAVE__) && defined(PHOENIX_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/expression.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/expression.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/expression.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -98,11 +98,20 @@
{ \
template <typename Dummy> \
struct meta_grammar::case_< \
- BOOST_PP_SEQ_FOR_EACH(PHOENIX_DEFINE_EXPRESSION_NS, _, BOOST_PP_SEQ_POP_BACK(NAME_SEQ)) tag:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ BOOST_PP_SEQ_FOR_EACH( \
+ PHOENIX_DEFINE_EXPRESSION_NS \
+ , _ \
+ , BOOST_PP_SEQ_POP_BACK(NAME_SEQ) \
+ ) tag:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
, Dummy \
> \
: enable_rule< \
- BOOST_PP_SEQ_FOR_EACH(PHOENIX_DEFINE_EXPRESSION_NS, _, BOOST_PP_SEQ_POP_BACK(NAME_SEQ)) rule:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ BOOST_PP_SEQ_FOR_EACH( \
+ PHOENIX_DEFINE_EXPRESSION_NS \
+ , _ \
+ , BOOST_PP_SEQ_POP_BACK(NAME_SEQ) \
+ ) rule:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) \
+ , Dummy \
> \
{}; \
} } \
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 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -76,7 +76,7 @@
template <typename This, typename Env, typename Actions>
struct result<This(Env &, Actions &)>
- : result_of::context<Env, Actions>
+ : result_of::context<Env &, Actions &>
{};
template <typename Env, typename Actions>
@@ -195,10 +195,31 @@
};
template <typename Env, typename Actions>
- typename result_of::context<Env, Actions>::type
+ typename result_of::context<Env const &, Actions const&>::type const
context(Env const& env, Actions const& actions)
{
- return fusion::vector2<Env, Actions>(env, actions);
+ return fusion::vector2<Env const &, Actions const &>(env, actions);
+ }
+
+ template <typename Env, typename Actions>
+ typename result_of::context<Env &, Actions const&>::type const
+ context(Env & env, Actions const& actions)
+ {
+ return fusion::vector2<Env &, Actions const &>(env, actions);
+ }
+
+ template <typename Env, typename Actions>
+ typename result_of::context<Env const &, Actions &>::type const
+ context(Env const& env, Actions & actions)
+ {
+ return fusion::vector2<Env const &, Actions &>(env, actions);
+ }
+
+ template <typename Env, typename Actions>
+ typename result_of::context<Env &, Actions &>::type const
+ context(Env & env, Actions & actions)
+ {
+ return fusion::vector2<Env &, Actions &>(env, actions);
}
struct _env
@@ -249,6 +270,13 @@
return fusion::at_c<0>(ctx);
}
+ template <typename Context>
+ typename fusion::result_of::at_c<Context const, 0>::type
+ env(Context const & ctx)
+ {
+ return fusion::at_c<0>(ctx);
+ }
+
struct _actions
: proto::transform<_actions>
{
@@ -297,6 +325,13 @@
return fusion::at_c<1>(ctx);
}
+ template <typename Context>
+ typename fusion::result_of::at_c<Context const, 1>::type
+ actions(Context const & ctx)
+ {
+ return fusion::at_c<1>(ctx);
+ }
+
template <typename T, typename Enable = void>
struct is_environment : fusion::traits::is_sequence<T> {};
}}
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 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -56,7 +56,7 @@
{};
};
- template <typename Rule>
+ template <typename Rule, typename Dummy = void>
struct enable_rule
: proto::when<Rule, proto::external_transform>
{};
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 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -10,13 +10,9 @@
#include <boost/phoenix/core/limits.hpp>
#include <boost/mpl/void.hpp>
#include <boost/phoenix/core/actor.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
-
-
-PHOENIX_DEFINE_EXPRESSION(
- (boost)(phoenix)(null)
- , (proto::terminal<mpl::void_>::type)
-)
+#include <boost/phoenix/core/value.hpp>
namespace boost { namespace phoenix
{
@@ -28,27 +24,35 @@
//
/////////////////////////////////////////////////////////////////////////////
- struct null_eval
+ namespace detail
+ {
+ struct nothing {};
+ }
+
+ namespace expression
{
- BOOST_PROTO_CALLABLE()
+ struct null
+ : expression::value<detail::nothing>
+ {};
+ }
+
+ template<typename Dummy>
+ struct is_custom_terminal<detail::nothing, Dummy>
+ : mpl::true_
+ {};
+ template<typename Dummy>
+ struct custom_terminal<detail::nothing, Dummy>
+ {
typedef void result_type;
- void operator()() const
- {}
+ template <typename Context>
+ void operator()(detail::nothing, Context &) const
+ {
+ }
};
- template <typename Dummy>
- struct default_actions::when<rule::null, Dummy>
- : proto::call<null_eval()>
- {};
-
- template <typename Dummy>
- struct is_nullary::when<rule::null, Dummy>
- : proto::make<mpl::true_()>
- {};
-
- expression::null<mpl::void_>::type const nothing = {};
+ expression::null::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 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -12,6 +12,7 @@
#include <boost/ref.hpp>
#include <boost/phoenix/core/actor.hpp>
#include <boost/phoenix/core/terminal.hpp>
+#include <boost/phoenix/core/value.hpp>
#include <boost/utility/result_of.hpp>
namespace boost { namespace phoenix
@@ -28,9 +29,9 @@
{
template <typename T>
struct reference
- : proto::terminal<reference_wrapper<T> >
+ : expression::value<reference_wrapper<T> >
{
- typedef actor<typename proto::terminal<reference_wrapper<T> >::type> type;
+ typedef typename expression::value<reference_wrapper<T> >::type type;
static const type make(T & t)
{
@@ -41,9 +42,9 @@
template <typename T>
struct reference<T const>
- : proto::terminal<reference_wrapper<T const> >
+ : expression::value<reference_wrapper<T const> >
{
- typedef actor<typename proto::terminal<reference_wrapper<T const> >::type> type;
+ typedef typename expression::value<reference_wrapper<T const> >::type type;
static const type make(T const & t)
{
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -11,16 +11,18 @@
#include <boost/phoenix/core/limits.hpp>
#include <boost/is_placeholder.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
+#include <boost/phoenix/core/terminal_fwd.hpp>
+#include <boost/proto/matches.hpp>
#include <boost/proto/transform/lazy.hpp>
#include <boost/proto/functional/fusion/at.hpp>
namespace boost { namespace phoenix
{
- template <typename T>
+ template <typename T, typename Dummy>
struct is_custom_terminal
: mpl::false_ {};
- template <typename T>
+ template <typename T, typename Dummy>
struct custom_terminal;
namespace rule
@@ -30,7 +32,7 @@
{};
struct custom_terminal
- : proto::if_<is_custom_terminal<proto::_value>()>
+ : proto::if_<boost::phoenix::is_custom_terminal<proto::_value>()>
{};
struct terminal
@@ -38,17 +40,17 @@
{};
}
- template <typename Grammar>
- struct meta_grammar::case_<proto::tag::terminal, Grammar>
+ template <typename Dummy>
+ struct meta_grammar::case_<proto::tag::terminal, Dummy>
: proto::or_<
- enable_rule<rule::argument >
- , enable_rule<rule::custom_terminal>
- , enable_rule<rule::terminal >
+ enable_rule<rule::argument , Dummy>
+ , enable_rule<rule::custom_terminal, Dummy>
+ , enable_rule<rule::terminal , Dummy>
>
{};
- template <typename Grammar>
- struct default_actions::when<rule::custom_terminal, Grammar>
+ template <typename Dummy>
+ struct default_actions::when<rule::custom_terminal, Dummy>
: proto::lazy<custom_terminal<proto::_value>(proto::_value, _context)>
{};
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal_fwd.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal_fwd.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal_fwd.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -17,10 +17,10 @@
struct terminal;
}
- template <typename T>
+ template <typename T, typename Dummy = void>
struct is_custom_terminal;
- template <typename T>
+ template <typename T, typename Dummy = void>
struct custom_terminal;
}}
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/function/function.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/function/function.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/function/function.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -63,7 +63,7 @@
template <typename Dummy>
struct meta_grammar::case_<proto::tag::function, Dummy>
- : enable_rule<rule::function>
+ : enable_rule<rule::function, Dummy>
{};
// functor which returns our lazy function call extension
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/object/const_cast.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/object/const_cast.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/object/const_cast.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -9,6 +9,7 @@
#define PHOENIX_OBJECT_CONST_CAST_HPP
#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/object/detail/target.hpp>
@@ -22,27 +23,31 @@
namespace boost { namespace phoenix
{
- template <typename T>
struct const_cast_eval
- : proto::callable
{
- typedef typename T::type result_type;
+ template <typename Sig>
+ struct result;
- template <typename Context, typename U>
- result_type
- operator()(Context& ctx, U const& u) const
+ template <typename This, typename Context, typename Target, typename Source>
+ struct result<This(Context, Target const &, Source const&)>
+ : detail::result_of::target<Target>
{
- return const_cast<result_type>(eval(u, ctx));
+ };
+
+ template <typename Context, typename Target, typename Source>
+ typename detail::result_of::target<Target>::type
+ operator()(Context const& ctx, Target, Source const& u) const
+ {
+ return
+ const_cast<
+ typename detail::result_of::target<Target>::type
+ >(eval(u, ctx));
}
};
template <typename Dummy>
struct default_actions::when<rule::const_cast_, Dummy>
- : proto::lazy<
- const_cast_eval<
- evaluator(proto::_child_c<0>, _context)
- >(_context, proto::_child_c<1>)
- >
+ : call<const_cast_eval, Dummy>
{};
template <typename T, typename U>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/object/construct.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/object/construct.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/object/construct.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -9,10 +9,12 @@
#define PHOENIX_OBJECT_CONSTRUCT_HPP
#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/object/detail/target.hpp>
#include <boost/phoenix/support/iterate.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
PHOENIX_DEFINE_EXPRESSION_VARARG(
(boost)(phoenix)(construct)
@@ -23,16 +25,22 @@
namespace boost { namespace phoenix
{
- template <typename T>
struct construct_eval
{
- typedef typename T::type result_type;
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename Context, typename A0>
+ struct result<This(Context, A0)>
+ : detail::result_of::target<A0>
+ {
+ };
- template <typename Context>
- result_type
- operator()(Context&) const
+ template <typename Context, typename Target>
+ typename detail::result_of::target<Target>::type
+ operator()(Context const&, Target) const
{
- return result_type();
+ return typename detail::result_of::target<Target>::type();
}
// Bring in the rest
@@ -40,43 +48,10 @@
};
-#define PHOENIX_CONSTRUCT_CHILD(Z, N, D) proto::_child_c<N>
-#define PHOENIX_CONSTRUCT_CALL(Z, N, D) \
- proto::when< \
- expression::construct< \
- proto::terminal<proto::_> \
- , BOOST_PP_ENUM_PARAMS(N, meta_grammar BOOST_PP_INTERCEPT) \
- > \
- , proto::lazy< \
- construct_eval<proto::_value(proto::_child_c<0>)>( \
- _context \
- , BOOST_PP_ENUM_SHIFTED( \
- BOOST_PP_INC(N) \
- , PHOENIX_CONSTRUCT_CHILD \
- , _ \
- ) \
- ) \
- > \
- > \
- /**/
-
template <typename Dummy>
struct default_actions::when<rule::construct, Dummy>
- : proto::or_<
- proto::when<
- expression::construct<proto::terminal<proto::_> >
- , proto::lazy<
- construct_eval<
- proto::_value(proto::_child_c<0>)
- >(_context)
- >
- >
- , BOOST_PP_ENUM_SHIFTED(PHOENIX_COMPOSITE_LIMIT, PHOENIX_CONSTRUCT_CALL, _)
- >
-
+ : call<construct_eval, Dummy>
{};
-#undef PHOENIX_CONSTRUCT_CHILD
-#undef PHOENIX_CONSTRUCT_CALL
template <typename T>
typename expression::construct<detail::target<T> >::type const
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/object/delete.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/object/delete.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/object/delete.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -21,7 +21,6 @@
namespace boost { namespace phoenix
{
struct delete_eval
- : proto::callable
{
typedef void result_type;
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/object/detail/construct_eval.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/object/detail/construct_eval.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/object/detail/construct_eval.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -24,7 +24,7 @@
==============================================================================*/
#define PHOENIX_ITERATION_PARAMS \
- (3, (1, PHOENIX_COMPOSITE_LIMIT, \
+ (3, (2, PHOENIX_COMPOSITE_LIMIT, \
<boost/phoenix/object/detail/construct_eval.hpp>))
#include PHOENIX_ITERATE()
@@ -35,15 +35,24 @@
#endif
#else
+
+ template <typename This, typename Context, PHOENIX_typename_A>
+ struct result<This(Context, PHOENIX_A)>
+ : detail::result_of::target<A0>
+ {
+ };
template <typename Context, PHOENIX_typename_A>
- result_type
- operator()(Context& ctx, PHOENIX_A_const_ref_a) const
+ typename detail::result_of::target<A0>::type
+ operator()(Context const& ctx, PHOENIX_A_const_ref_a) const
{
#define EVAL_a(_,n,__) \
- BOOST_PP_COMMA_IF(n) eval(a ## n, ctx)
+ BOOST_PP_COMMA_IF(BOOST_PP_DEC(n)) eval(a ## n, ctx)
- return result_type(BOOST_PP_REPEAT(PHOENIX_ITERATION, EVAL_a, _));
+ return
+ typename detail::result_of::target<A0>::type(
+ BOOST_PP_REPEAT_FROM_TO(1, PHOENIX_ITERATION, EVAL_a, _)
+ );
#undef EVAL_a
}
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/object/detail/target.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/object/detail/target.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/object/detail/target.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -17,6 +17,30 @@
{
typedef T type;
};
+
+ namespace result_of
+ {
+ template <typename T>
+ struct target
+ {
+ typedef
+ typename proto::detail::uncvref<
+ typename proto::result_of::value<T>::type
+ >::type
+ target_type;
+ typedef typename target_type::type type;
+ };
+
+ template <typename T>
+ struct target<T const&>
+ : target<T>
+ {};
+
+ template <typename T>
+ struct target<T&>
+ : target<T>
+ {};
+ };
}
}}
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/object/dynamic_cast.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/object/dynamic_cast.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/object/dynamic_cast.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -9,6 +9,7 @@
#define PHOENIX_OBJECT_DYNAMIC_CAST_HPP
#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/object/detail/target.hpp>
@@ -22,27 +23,31 @@
namespace boost { namespace phoenix
{
- template <typename T>
struct dynamic_cast_eval
- : proto::callable
{
- typedef typename T::type result_type;
+ template <typename Sig>
+ struct result;
- template <typename Context, typename U>
- result_type
- operator()(Context& ctx, U const& u) const
+ template <typename This, typename Context, typename Target, typename Source>
+ struct result<This(Context, Target const &, Source const&)>
+ : detail::result_of::target<Target>
{
- return dynamic_cast<result_type>(eval(u, ctx));
+ };
+
+ template <typename Context, typename Target, typename Source>
+ typename detail::result_of::target<Target>::type
+ operator()(Context const& ctx, Target, Source const& u) const
+ {
+ return
+ dynamic_cast<
+ typename detail::result_of::target<Target>::type
+ >(eval(u, ctx));
}
};
template <typename Dummy>
struct default_actions::when<rule::dynamic_cast_, Dummy>
- : proto::lazy<
- dynamic_cast_eval<
- evaluator(proto::_child_c<0>, _context)
- >(_context, proto::_child_c<1>)
- >
+ : call<dynamic_cast_eval, Dummy>
{};
template <typename T, typename U>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/object/new.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/object/new.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/object/new.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -28,7 +28,6 @@
//template <typename T>
struct new_eval
- : proto::callable
{
template <typename Sig>
struct result;
@@ -36,16 +35,16 @@
template <typename This, typename Context, typename A0>
struct result<This(Context, A0)>
{
- typedef typename proto::detail::uncvref<typename proto::result_of::value<A0>::type>::type target_type;
+ typedef typename detail::result_of::target<A0> target_type;
typedef typename target_type::type construct_type;
typedef typename target_type::type * type;
};
template <typename Context, typename Target>
- typename result<new_eval(Context const &, Target)>::type
+ typename detail::result_of::target<Target>::type *
operator()(Context const&, Target) const
{
- return new typename result<new_eval(Context const &, Target)>::construct_type;
+ return new typename detail::result_of::target<Target>::type;
}
// Bring in the rest
@@ -54,7 +53,7 @@
template <typename Dummy>
struct default_actions::when<rule::new_, Dummy>
- : call<new_eval>
+ : call<new_eval, Dummy>
{};
template <typename T>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/object/reinterpret_cast.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/object/reinterpret_cast.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/object/reinterpret_cast.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -9,6 +9,7 @@
#define PHOENIX_OBJECT_REINTERPRET_CAST_HPP
#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/object/detail/target.hpp>
@@ -23,25 +24,31 @@
namespace boost { namespace phoenix
{
- template <typename T>
struct reinterpret_cast_eval
- : proto::callable
{
- typedef typename T::type result_type;
+ template <typename Sig>
+ struct result;
- template <typename Context, typename U>
- result_type
- operator()(Context& ctx, U const& u) const
+ template <typename This, typename Context, typename Target, typename Source>
+ struct result<This(Context, Target const &, Source const&)>
+ : detail::result_of::target<Target>
{
- return reinterpret_cast<result_type>(eval(u, ctx));
+ };
+
+ template <typename Context, typename Target, typename Source>
+ typename detail::result_of::target<Target>::type
+ operator()(Context const& ctx, Target, Source const& u) const
+ {
+ return
+ reinterpret_cast<
+ typename detail::result_of::target<Target>::type
+ >(eval(u, ctx));
}
};
template <typename Dummy>
struct default_actions::when<rule::reinterpret_cast_, Dummy>
- : proto::lazy<
- reinterpret_cast_eval<evaluator(proto::_child_c<0>, _context)
- >(_context, proto::_child_c<1>)>
+ : call<reinterpret_cast_eval, Dummy>
{};
template <typename T, typename U>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/object/static_cast.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/object/static_cast.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/object/static_cast.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -9,6 +9,7 @@
#define PHOENIX_OBJECT_STATIC_CAST_HPP
#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/object/detail/target.hpp>
@@ -22,25 +23,30 @@
namespace boost { namespace phoenix
{
- template <typename T>
struct static_cast_eval
- : proto::callable
{
- typedef typename T::type result_type;
+ template <typename Sig>
+ struct result;
- template <typename Context, typename U>
- result_type
- operator()(Context& ctx, U const& u) const
+ template <typename This, typename Context, typename Target, typename Source>
+ struct result<This(Context, Target const &, Source const&)>
+ : detail::result_of::target<Target>
{
- return static_cast<result_type>(eval(u, ctx));
+ };
+
+ template <typename Context, typename Target, typename Source>
+ typename detail::result_of::target<Target>::type
+ operator()(Context const& ctx, Target, Source const& u) const
+ {
+ return static_cast<
+ typename detail::result_of::target<Target>::type
+ >(eval(u, ctx));
}
};
template <typename Dummy>
struct default_actions::when<rule::static_cast_, Dummy>
- : proto::lazy<
- static_cast_eval<evaluator(proto::_child_c<0>, _context)
- >(_context, proto::_child_c<1>)>
+ : call<static_cast_eval, Dummy>
{};
template <typename T, typename U>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/operator/detail/define_operator.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/operator/detail/define_operator.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/operator/detail/define_operator.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -27,7 +27,7 @@
#define PHOENIX_GRAMMAR(_, __, name) \
template <typename Dummy> \
struct meta_grammar::case_<proto::tag::name, Dummy> \
- : enable_rule<rule::name> \
+ : enable_rule<rule::name, Dummy> \
{}; \
/**/
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/operator/if_else.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/operator/if_else.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/operator/if_else.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -41,7 +41,7 @@
template <typename Dummy>
struct meta_grammar::case_<tag::if_else_operator, Dummy>
- : enable_rule<rule::if_else_operator>
+ : enable_rule<rule::if_else_operator, Dummy>
{};
using proto::if_else;
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/operator/member.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/operator/member.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/operator/member.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -86,34 +86,9 @@
}
struct mem_fun_ptr_eval
- : proto::callable
{
template<typename Sig>
struct result;
-
- /*
- template <typename This, typename Context, typename Expr>
- struct result<This(Context, Expr const &)>
- : result<This(Context const &, Expr const &)>
- {};
-
- template <typename This, typename Context, typename Expr>
- struct result<This(Context &, Expr const &)>
- : result_of::mem_fun_ptr_eval<Context, Expr>
- {};
-
- template <typename Context, typename Expr>
- typename result_of::mem_fun_ptr_eval<Context, Expr>::type
- operator()(Context & ctx, Expr const & expr) const
- {
- return
- this->evaluate(
- ctx
- , expr
- , typename proto::arity_of<Expr>::type()
- );
- }
- */
#define PHOENIX_MEMBER_EVAL(Z, N, D) \
BOOST_PP_COMMA_IF(BOOST_PP_NOT(BOOST_PP_EQUAL(N, 2))) \
@@ -131,7 +106,6 @@
template <typename Dummy>
struct default_actions::when<rule::mem_fun_ptr, Dummy>
- // : proto::call<mem_fun_ptr_eval(_context, proto::_)>
: call<mem_fun_ptr_eval>
{};
}}
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/scope/detail/local_var_def.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/scope/detail/local_var_def.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/scope/detail/local_var_def.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -17,13 +17,13 @@
fusion::pair<BOOST_PP_CAT(Tag, N), BOOST_PP_CAT(A, N)>
#define M1(Z, N, D) \
- fusion::pair<BOOST_PP_CAT(Tag, N), typename evaluator::impl<BOOST_PP_CAT(A, N) const &, Context const &, int>::result_type >
+ fusion::pair<BOOST_PP_CAT(Tag, N), typename evaluator::impl<BOOST_PP_CAT(A, N) const &, Context, int>::result_type >
#define M2(Z, N, D) \
typedef \
fusion::pair< \
BOOST_PP_CAT(Tag, N) \
- , typename evaluator::impl<BOOST_PP_CAT(A, N) const &, Context const &, int>::result_type \
+ , typename evaluator::impl<BOOST_PP_CAT(A, N) const &, Context, int>::result_type \
> \
BOOST_PP_CAT(pair, N);
#define M3(Z, N, D) \
@@ -88,7 +88,24 @@
fusion::map<
BOOST_PP_ENUM(PHOENIX_ITERATION, M0, _)
> const &
- , Context const &
+ , Context
+ )
+ > : result<
+ This(
+ fusion::map<
+ BOOST_PP_ENUM(PHOENIX_ITERATION, M0, _)
+ > &
+ , Context
+ )
+ > {};
+
+ template <typename This, BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename Tag), PHOENIX_typename_A, typename Context>
+ struct result<
+ This(
+ fusion::map<
+ BOOST_PP_ENUM(PHOENIX_ITERATION, M0, _)
+ > &
+ , Context
)
>
{
@@ -100,7 +117,7 @@
};
template <BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename Tag), PHOENIX_typename_A, typename Context>
- typename result<local_var_def_eval(fusion::map<BOOST_PP_ENUM(PHOENIX_ITERATION, M0, _) > const &, Context const &)>::type
+ typename result<local_var_def_eval(fusion::map<BOOST_PP_ENUM(PHOENIX_ITERATION, M0, _) > &, Context const &)>::type
operator()(fusion::map<BOOST_PP_ENUM(PHOENIX_ITERATION, M0, _) > const & locals, Context const & ctx) const
{
BOOST_PP_REPEAT(PHOENIX_ITERATION, M2, _)
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/scope/lambda.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/scope/lambda.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/scope/lambda.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -11,6 +11,7 @@
#include <boost/phoenix/core/limits.hpp>
#include <boost/mpl/int.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/scope/local_variable.hpp>
@@ -40,62 +41,34 @@
, typename Locals
, typename Lambda
>
- struct result<This(Context, OuterEnv, Locals, Lambda)>
- : result<This(Context const &, OuterEnv &, Locals &, Lambda &)>
- {};
-
- template <
- typename This
- , typename Context
- , typename OuterEnv
- , typename Locals
- , typename Lambda
- >
struct result<This(Context, OuterEnv &, Locals &, Lambda &)>
- : result<This(Context const &, OuterEnv &, Locals &, Lambda &)>
- {};
-
- template <
- typename This
- , typename Context
- , typename OuterEnv
- , typename Locals
- , typename Lambda
- >
- struct result<This(Context &, OuterEnv &, Locals &, Lambda &)>
{
typedef
- typename proto::detail::uncvref<
- typename result_of::env<Context>::type
- >::type
+ typename result_of::env<Context>::type
env_type;
typedef
- typename proto::detail::uncvref<
- typename result_of::actions<Context>::type
- >::type
+ typename result_of::actions<Context>::type
actions_type;
typedef
- typename proto::detail::uncvref<
- typename proto::result_of::value<Locals>::type
- >::type
+ typename proto::result_of::value<Locals>::type
locals_type;
typedef
- typename proto::detail::uncvref<OuterEnv>::type
+ typename proto::result_of::value<OuterEnv>::type
outer_env_type;
typedef
- scoped_environment<env_type, outer_env_type const, locals_type const>
+ scoped_environment<env_type, outer_env_type, locals_type>
scoped_env;
typedef
- typename result_of::context<scoped_env, actions_type&>::type
+ typename result_of::context<scoped_env, actions_type>::type
ctx_type;
typedef
- typename evaluator::impl<Lambda const &, ctx_type&, int>::result_type
+ typename evaluator::impl<Lambda const &, ctx_type const&, int>::result_type
type;
};
@@ -106,39 +79,33 @@
, typename Lambda
>
typename result<
- lambda_eval(Context &, OuterEnv const&, Locals &, Lambda &)
+ lambda_eval(Context const&, OuterEnv const&, Locals const&, Lambda const&)
>::type
operator()(
- Context& ctx
+ Context const& ctx
, OuterEnv const & outer_env
, Locals const& locals
, Lambda const& lambda
) const
{
typedef
- typename proto::detail::uncvref<
- typename result_of::env<Context>::type
- >::type
+ typename result_of::env<Context>::type
env_type;
typedef
- typename proto::detail::uncvref<
- typename result_of::actions<Context>::type
- >::type
+ typename result_of::actions<Context>::type
actions_type;
typedef
- typename proto::detail::uncvref<
- typename proto::result_of::value<Locals>::type
- >::type
+ typename proto::result_of::value<Locals>::type
locals_type;
typedef
- typename proto::detail::uncvref<OuterEnv>::type
+ typename proto::result_of::value<OuterEnv>::type
outer_env_type;
typedef
- scoped_environment<env_type, OuterEnv const, locals_type const>
+ scoped_environment<env_type, outer_env_type, locals_type>
scoped_env_type;
env_type e(env(ctx));
@@ -146,11 +113,11 @@
scoped_env_type
scoped_env(
e
- , outer_env
+ , proto::value(outer_env)
, proto::value(locals)
);
- typename result_of::context<scoped_env_type, actions_type&>::type
+ typename result_of::context<scoped_env_type &, actions_type>::type
new_ctx(scoped_env, actions(ctx));
return eval(lambda, new_ctx);
}
@@ -158,29 +125,16 @@
template <typename Dummy>
struct default_actions::when<rule::lambda, Dummy>
- : proto::call<
- lambda_eval(
- _context
- , proto::_value(proto::_child_c<0>)
- , proto::_child_c<1>
- , proto::_child_c<2>
- )
- >
+ : call<lambda_eval, Dummy>
{};
template <typename Dummy>
struct is_nullary::when<rule::lambda, Dummy>
- : proto::when<
- expression::lambda<
- proto::terminal<proto::_>
- , proto::terminal<proto::_>
- , meta_grammar
- >
- , evaluator(
+ : proto::call<
+ evaluator(
proto::_child_c<2>
- , _context(
- proto::_
- , mpl::true_()
+ , functional::context(
+ mpl::true_()
, detail::scope_is_nullary_actions()
)
, int()
@@ -238,17 +192,16 @@
template <typename Dummy>
struct meta_grammar::case_<tag::lambda_actor, Dummy>
- : enable_rule<rule::lambda_actor>
+ : enable_rule<rule::lambda_actor, Dummy>
{};
struct lambda_actor_eval
- : proto::callable
{
template <typename Sig>
struct result;
template <typename This, typename Context, typename Lambda>
- struct result<This(Context, Lambda)>
+ struct result<This(Context, Lambda const &)>
{
typedef
typename proto::detail::uncvref<
@@ -260,13 +213,13 @@
typename expression::lambda<
env_type
, mpl::void_
- , typename proto::detail::uncvref<Lambda>::type
+ , Lambda
>::type
type;
};
template <typename This, typename Context, typename Locals, typename Lambda>
- struct result<This(Context, Locals, Lambda)>
+ struct result<This(Context, Locals const &, Lambda const &)>
{
typedef
typename
@@ -275,7 +228,7 @@
typename proto::result_of::value<
Locals const &
>::type
- , Context const &
+ , Context
)
>::type
locals_type;
@@ -290,14 +243,14 @@
typename expression::lambda<
env_type
, locals_type
- , typename proto::detail::uncvref<Lambda>::type
+ , Lambda
>::type const
type;
};
template <typename Context, typename Lambda>
- typename result<lambda_actor_eval(Context&, Lambda const&)>::type
- operator()(Context & ctx, Lambda const& lambda) const
+ typename result<lambda_actor_eval(Context const&, Lambda const&)>::type
+ operator()(Context const& ctx, Lambda const& lambda) const
{
typedef
typename proto::detail::uncvref<
@@ -318,9 +271,9 @@
, typename Lambda
>
typename result<
- lambda_actor_eval(Context&, Locals const&, Lambda const&)
+ lambda_actor_eval(Context const &, Locals const&, Lambda const&)
>::type
- operator()(Context & ctx, Locals const& locals, Lambda const& lambda) const
+ operator()(Context const & ctx, Locals const& locals, Lambda const& lambda) const
{
typedef
typename
@@ -329,7 +282,7 @@
typename proto::result_of::value<
Locals const &
>::type
- , Context &
+ , Context const &
)
>::type
locals_type;
@@ -352,19 +305,7 @@
template <typename Dummy>
struct default_actions::when<rule::lambda_actor, Dummy>
- : proto::or_<
- proto::when<
- expression::lambda_actor<meta_grammar>
- , lambda_actor_eval(_context, proto::_child_c<0>)
- >
- , proto::when<
- expression::lambda_actor<
- proto::terminal<proto::_>
- , meta_grammar
- >
- , lambda_actor_eval(_context, proto::_child_c<0>, proto::_child_c<1>)
- >
- >
+ : call<lambda_actor_eval, Dummy>
{};
template <typename Locals = void, typename Dummy = void>
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 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -11,6 +11,7 @@
#include <boost/phoenix/core/limits.hpp>
#include <boost/fusion/algorithm/transformation/transform.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/scope/scoped_environment.hpp>
@@ -31,12 +32,10 @@
struct result;
template <typename This, typename Context, typename Locals, typename Let>
- struct result<This(Context, Locals &, Let &)>
+ struct result<This(Context, Locals const &, Let const &)>
{
typedef
- typename proto::detail::uncvref<
- typename result_of::actions<Context>::type
- >::type
+ typename result_of::actions<Context>::type
actions_type;
typedef
@@ -44,9 +43,9 @@
boost::result_of<
detail::local_var_def_eval(
typename proto::result_of::value<
- Locals const &
+ Locals &
>::type
- , Context const &
+ , Context
)
>::type
locals_type;
@@ -68,19 +67,15 @@
};
template <typename Context, typename Locals, typename Let>
- typename result<let_eval(Context&, Locals const &, Let const &)>::type
- operator()(Context & ctx, Locals const & locals, Let const & let) const
+ typename result<let_eval(Context const&, Locals const &, Let const &)>::type
+ operator()(Context const& ctx, Locals const & locals, Let const & let) const
{
typedef
- typename proto::detail::uncvref<
- typename result_of::env<Context>::type
- >::type
+ typename result_of::env<Context>::type
env_type;
typedef
- typename proto::detail::uncvref<
- typename result_of::actions<Context>::type
- >::type
+ typename result_of::actions<Context>::type
actions_type;
typedef
@@ -100,7 +95,6 @@
locals_type l
= detail::local_var_def_eval()(proto::value(locals), ctx);
-
scoped_env_type
scoped_env(
env(ctx)
@@ -119,7 +113,7 @@
template <typename Dummy>
struct default_actions::when<rule::let, Dummy>
- : proto::call<let_eval(_context, proto::_child_c<0>, proto::_child_c<1>)>
+ : call<let_eval, Dummy>
{};
template <typename Locals = void, typename Dummy = void>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/scope/local_variable.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/scope/local_variable.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/scope/local_variable.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -11,6 +11,7 @@
#include <boost/phoenix/core/limits.hpp>
#include <boost/fusion/container/map.hpp>
#include <boost/fusion/container/generation/make_map.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/reference.hpp>
#include <boost/phoenix/core/value.hpp>
@@ -58,7 +59,7 @@
template <typename Dummy>
struct meta_grammar::case_<tag::local_variable, Dummy>
- : enable_rule<rule::local_variable>
+ : enable_rule<rule::local_variable, Dummy>
{};
template <typename Dummy>
@@ -92,11 +93,6 @@
struct local_var_not_found
{
- template <typename T>
- T const & operator=(T const & t)
- {
- return t;
- }
};
}
@@ -119,17 +115,17 @@
: mpl::eval_if_c<
fusion::result_of::has_key<Locals, Key>::type::value
, fusion::result_of::at_key<Locals, Key>
- , result<This(OuterEnv&, Key)>
+ , result<This(typename proto::detail::uncvref<OuterEnv>::type&, Key)>
>
{};
template <typename This, typename Env, typename OuterEnv, typename Key>
- struct result<This(scoped_environment<Env, OuterEnv, const mpl::void_> const&, Key)>
+ struct result<This(scoped_environment<Env, OuterEnv, mpl::void_> const&, Key)>
: result<This(OuterEnv&, Key)>
{};
template <typename This, typename Env, typename OuterEnv, typename Key>
- struct result<This(scoped_environment<Env, OuterEnv, const mpl::void_>&, Key)>
+ struct result<This(scoped_environment<Env, OuterEnv, mpl::void_>&, Key)>
: result<This(OuterEnv&, Key)>
{};
@@ -154,15 +150,15 @@
}
template <typename Env, typename OuterEnv, typename Key>
- typename result<get_local(scoped_environment<Env, OuterEnv, const mpl::void_>&, Key)>::type
- operator()(scoped_environment<Env, OuterEnv, const mpl::void_>& env, Key k) const
+ typename result<get_local(scoped_environment<Env, OuterEnv, mpl::void_>&, Key)>::type
+ operator()(scoped_environment<Env, OuterEnv, mpl::void_>& env, Key k) const
{
return (*this)(env.outer_env, k);
}
template <typename Env, typename OuterEnv, typename Key>
- typename result<get_local(scoped_environment<Env, OuterEnv, const mpl::void_>&, Key)>::type
- operator()(scoped_environment<Env, OuterEnv, const mpl::void_> const& env, Key k) const
+ typename result<get_local(scoped_environment<Env, OuterEnv, mpl::void_>&, Key)>::type
+ operator()(scoped_environment<Env, OuterEnv, mpl::void_> const& env, Key k) const
{
return (*this)(env.outer_env, k);
}
@@ -194,36 +190,35 @@
};
struct local_var_eval
- : proto::callable
{
template <typename Sig>
struct result;
- template <typename This, typename Local, typename Context>
- struct result<This(Local const &, Context)>
+ template <typename This, typename Context, typename Local>
+ struct result<This(Context, Local const &)>
{
typedef
typename get_local::
template result<
get_local(
typename result_of::env<Context>::type
- , Local
+ , typename proto::result_of::value<Local>::type
)
>::type
type;
};
template <typename Local, typename Context>
- typename result<local_var_eval(Local const &, Context&)>::type
- operator()(Local const & local, Context & ctx)
+ typename result<local_var_eval(Context const&, Local const &)>::type
+ operator()(Context const & ctx, Local const & local)
{
- return get_local()(env(ctx), local);
+ return get_local()(env(ctx), proto::value(local));
}
};
template <typename Dummy>
struct default_actions::when<rule::local_variable, Dummy>
- : proto::call<local_var_eval(proto::_value(proto::_child_c<0>), _context)>
+ : call<local_var_eval, Dummy>
{};
namespace local_names
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/scope/scoped_environment.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/scope/scoped_environment.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/scope/scoped_environment.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -27,14 +27,24 @@
, fusion::random_access_traversal_tag
>
{
+ /*
typedef typename boost::remove_reference<Env>::type env_type;
typedef typename boost::remove_reference<OuterEnv>::type outer_env_type;
typedef typename boost::remove_reference<Locals>::type locals_type;
+ */
+ typedef Env env_type;
+ typedef OuterEnv outer_env_type;
+ typedef Locals locals_type;
scoped_environment(
+ /*
env_type& env
, outer_env_type& outer_env
, locals_type & locals
+ */
+ Env env
+ , OuterEnv outer_env
+ , Locals locals
)
: env(env)
, outer_env(outer_env)
@@ -47,9 +57,14 @@
, locals(o.locals)
{}
- env_type &env;
- outer_env_type &outer_env;
- locals_type &locals;
+ /*
+ env_type env;
+ outer_env_type outer_env;
+ locals_type locals;
+ */
+ Env env;
+ OuterEnv outer_env;
+ Locals locals;
#define PHOENIX_ADAPT_SCOPED_ENVIRONMENT(INTRINSIC) \
template <typename Seq> \
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/detail/switch.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/detail/switch.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/detail/switch.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -1,4 +1,5 @@
+/*
#if !defined(PHOENIX_DONT_USE_PREPROCESSED_FILES)
#ifndef PHOENIX_STATEMENT_DETAIL_SWITCH_HPP
#define PHOENIX_STATEMENT_DETAIL_SWITCH_HPP
@@ -9,6 +10,7 @@
#endif
#else
+*/
#if !PHOENIX_IS_ITERATING
@@ -35,40 +37,40 @@
#define PHOENIX_SWITCH_EVAL_TYPEDEF_R(Z, N, DATA) \
typedef \
- typename boost::result_of< \
- detail::switch_grammar( \
- Cases \
- , mpl::int_<N> \
- , mpl::int_<DATA> \
- ) \
+ typename fusion::result_of::deref< \
+ typename fusion::result_of::advance_c< \
+ flat_view_begin \
+ , N \
+ >::type \
>::type \
BOOST_PP_CAT(case, N); \
typedef \
- typename proto::result_of::value< \
- typename proto::result_of::child_c< \
- BOOST_PP_CAT(case, N) \
- , 0 \
+ typename proto::detail::uncvref< \
+ typename proto::result_of::value< \
+ typename proto::result_of::child_c< \
+ BOOST_PP_CAT(case, N) \
+ , 0 \
+ >::type \
>::type \
>::type \
BOOST_PP_CAT(case_label, N); \
- mpl::int_<N> BOOST_PP_CAT(idx, N); \
/**/
#define PHOENIX_SWITCH_EVAL_R(Z, N, DATA) \
case BOOST_PP_CAT(case_label, N)::value : \
eval( \
proto::child_c<1>( \
- detail::switch_grammar()( \
- cases, BOOST_PP_CAT(idx, N), size \
+ fusion::deref( \
+ fusion::advance_c<N>(fusion::begin(flat_view)) \
) \
) \
, ctx \
); \
- break;
+ break; \
/**/
#define PHOENIX_ITERATION_PARAMS \
- (3, (0, PHOENIX_LIMIT, \
+ (3, (2, PHOENIX_LIMIT, \
<boost/phoenix/statement/detail/switch.hpp>))
#include PHOENIX_ITERATE()
@@ -92,11 +94,22 @@
, mpl::false_
) const
{
+ typedef
+ typename proto::result_of::flatten<Cases const&>::type
+ flat_view_type;
+
+ typedef
+ typename fusion::result_of::begin<flat_view_type>::type
+ flat_view_begin;
+
+ flat_view_type flat_view(proto::flatten(cases));
+
BOOST_PP_REPEAT(
PHOENIX_ITERATION
, PHOENIX_SWITCH_EVAL_TYPEDEF_R
, PHOENIX_ITERATION
)
+
switch(eval(cond, ctx))
{
BOOST_PP_REPEAT(PHOENIX_ITERATION, PHOENIX_SWITCH_EVAL_R, _)
@@ -113,13 +126,22 @@
, mpl::true_
) const
{
+ typedef
+ typename proto::result_of::flatten<Cases const&>::type
+ flat_view_type;
+
+ typedef
+ typename fusion::result_of::begin<flat_view_type>::type
+ flat_view_begin;
+
+ flat_view_type flat_view(proto::flatten(cases));
+
BOOST_PP_REPEAT(
BOOST_PP_DEC(PHOENIX_ITERATION)
, PHOENIX_SWITCH_EVAL_TYPEDEF_R
, PHOENIX_ITERATION
)
- mpl::int_<BOOST_PP_DEC(PHOENIX_ITERATION)>
- BOOST_PP_CAT(idx, BOOST_PP_DEC(PHOENIX_ITERATION));
+
switch(eval(cond, ctx))
{
BOOST_PP_REPEAT(
@@ -129,13 +151,10 @@
default:
eval(
proto::child_c<0>(
- detail::switch_grammar()(
- cases
- , BOOST_PP_CAT(
- idx
- , BOOST_PP_DEC(PHOENIX_ITERATION)
- )
- , size
+ fusion::deref(
+ fusion::advance_c<
+ BOOST_PP_DEC(PHOENIX_ITERATION)
+ >(fusion::begin(flat_view))
)
)
, ctx
@@ -145,4 +164,4 @@
#endif
-#endif // PHOENIX_DONT_USE_PREPROCESSED_FILES
+//#endif // PHOENIX_DONT_USE_PREPROCESSED_FILES
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/do_while.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/do_while.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/do_while.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -9,6 +9,7 @@
#define PHOENIX_STATEMENT_DO_WHILE_HPP
#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
@@ -20,16 +21,13 @@
namespace boost { namespace phoenix
{
-
-
struct do_while_eval
- : proto::callable
{
typedef void result_type;
template <typename Context, typename Cond, typename Do>
result_type
- operator()(Context& ctx, Cond const& cond, Do const& do_) const
+ operator()(Context const& ctx, Cond const& cond, Do const& do_) const
{
do
eval(do_, ctx);
@@ -39,13 +37,7 @@
template <typename Dummy>
struct default_actions::when<rule::do_while, Dummy>
- : proto::call<
- do_while_eval(
- _context
- , proto::_child_c<0> // Cond
- , proto::_child_c<1> // Do
- )
- >
+ : call<do_while_eval, Dummy>
{};
template <typename Do>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/for.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/for.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/for.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -9,6 +9,7 @@
#define PHOENIX_STATEMENT_FOR_HPP
#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
@@ -34,7 +35,7 @@
, typename Do>
result_type
operator()(
- Context& ctx
+ Context const& ctx
, Init const& init
, Cond const& cond
, Step const& step
@@ -47,15 +48,7 @@
template <typename Dummy>
struct default_actions::when<rule::for_, Dummy>
- : proto::call<
- for_eval(
- _context
- , proto::_child_c<0> // Cond
- , proto::_child_c<1> // Init
- , proto::_child_c<2> // Step
- , proto::_child_c<3> // Do
- )
- >
+ : call<for_eval, Dummy>
{};
template <typename Init, typename Cond, typename Step>
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 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -11,6 +11,7 @@
#include <boost/config.hpp>
#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/core/actor.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
@@ -49,13 +50,12 @@
// and
// if_( foo )[ bar ].else_[ baz ]
struct if_else_eval
- : proto::callable
{
typedef void result_type;
template<typename Context, typename Cond, typename Then>
result_type
- operator()(Context & ctx, Cond const & cond, Then const & then) const
+ operator()(Context const & ctx, Cond const & cond, Then const & then) const
{
if( eval( cond, ctx ) )
eval( then, ctx );
@@ -64,7 +64,7 @@
template<typename Context, typename Cond, typename Then, typename Else>
result_type
operator()(
- Context & ctx
+ Context const & ctx
, Cond const & cond
, Then const & then
, Else const & else_) const
@@ -78,25 +78,12 @@
template <typename Dummy>
struct default_actions::when<rule::if_, Dummy>
- : proto::call<
- if_else_eval(
- _context
- , proto::_child_c<0> // Cond
- , proto::_child_c<1> // Then
- )
- >
+ : call<if_else_eval, Dummy>
{};
template <typename Dummy>
struct default_actions::when<rule::if_else_statement, Dummy>
- : proto::call<
- if_else_eval(
- _context
- , proto::_child_c<0> // Cond
- , proto::_child_c<1> // Then
- , proto::_child_c<2> // Else
- )
- >
+ : call<if_else_eval, Dummy>
{};
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/sequence.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/sequence.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/sequence.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -36,7 +36,7 @@
template <typename Dummy>
struct meta_grammar::case_<proto::tag::comma, Dummy>
- : enable_rule<rule::sequence>
+ : enable_rule<rule::sequence, Dummy>
{};
}}
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 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -9,56 +9,42 @@
#define PHOENIX_STATEMENT_SWITCH_HPP
#include <boost/phoenix/core/limits.hpp>
-#include <boost/phoenix/core/meta_grammar.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
+#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/is_nullary.hpp>
#include <boost/phoenix/support/iterate.hpp>
#include <boost/proto/make_expr.hpp>
-namespace boost { namespace phoenix
-{
- namespace tag
- {
- struct switch_case {};
- struct switch_default_case {};
- }
+#include <boost/fusion/include/as_vector.hpp>
- namespace expression
- {
- template <typename N, typename A>
- struct switch_case
- : proto::binary_expr<tag::switch_case, N, A>
- {};
-
- template <typename A>
- struct switch_default_case
- : proto::unary_expr<tag::switch_default_case, A>
- {};
- }
+PHOENIX_DEFINE_EXPRESSION(
+ (boost)(phoenix)(switch_case)
+ , (proto::terminal<proto::_>)
+ (meta_grammar)
+)
- namespace rule
- {
- struct switch_case
- : expression::switch_case<
- proto::terminal<proto::_>
- , meta_grammar
- >
- {};
-
- struct switch_default_case
- : expression::switch_default_case<
- meta_grammar
- >
- {};
- }
+PHOENIX_DEFINE_EXPRESSION(
+ (boost)(phoenix)(switch_default_case)
+ , (meta_grammar)
+)
+
+namespace boost { namespace phoenix
+{
namespace detail
{
struct switch_case_grammar;
struct switch_case_with_default_grammar;
struct switch_grammar
: proto::or_<
- detail::switch_case_grammar
- , detail::switch_case_with_default_grammar
+ proto::when<
+ detail::switch_case_grammar
+ , mpl::false_()
+ >
+ , proto::when<
+ detail::switch_case_with_default_grammar
+ , mpl::true_()
+ >
>
{};
}
@@ -77,8 +63,8 @@
proto::_child_c<0>
, proto::_state
)
- , evaluator(
- proto::_child_c<0>(proto::_child_c<1>)
+ , switch_case_is_nullary(
+ proto::_child_c<1>
, proto::_state
)
>()
@@ -92,36 +78,14 @@
struct switch_case_grammar
: proto::or_<
- proto::when<
- proto::comma<switch_case_grammar, rule::switch_case>
- , proto::if_<
- is_same<mpl::prior<proto::_data>(), proto::_state>()
- , proto::_child_c<1>
- , switch_case_grammar(
- proto::_child_c<0>
- , proto::_state
- , mpl::prior<proto::_data>()
- )
- >
- >
+ proto::comma<switch_case_grammar, rule::switch_case>
, proto::when<rule::switch_case, proto::_>
>
{};
struct switch_case_with_default_grammar
: proto::or_<
- proto::when<
- proto::comma<switch_case_grammar, rule::switch_default_case>
- , proto::if_<
- is_same<mpl::prior<proto::_data>(), proto::_state>()
- , proto::_child_c<1>
- , switch_case_grammar(
- proto::_child_c<0>
- , proto::_state
- , mpl::prior<proto::_data>()
- )
- >
- >
+ proto::comma<switch_case_grammar, rule::switch_default_case>
, proto::when<rule::switch_default_case, proto::_>
>
{};
@@ -174,28 +138,62 @@
ctx
, cond
, cases
- , typename boost::result_of<detail::switch_size(Cases)>::type()
- , typename proto::matches<
- Cases
- , detail::switch_case_with_default_grammar
- >::type()
+ , typename detail::switch_size::impl<Cases, int, int>::result_type()
+ , typename detail::switch_grammar::impl<Cases, int, int>::result_type()
);
}
private:
+ template <typename Context, typename Cond, typename Cases>
+ result_type
+ evaluate(
+ Context & ctx
+ , Cond const & cond
+ , Cases const & cases
+ , mpl::int_<1> size
+ , mpl::false_
+ ) const
+ {
+ typedef
+ typename proto::result_of::value<
+ typename proto::result_of::child_c<
+ Cases
+ , 0
+ >::type
+ >::type
+ case_label;
+
+ switch(eval(cond, ctx))
+ {
+ case case_label::value:
+ eval(proto::child_c<1>(cases), ctx);
+ }
+ }
+
+ template <typename Context, typename Cond, typename Cases>
+ result_type
+ evaluate(
+ Context & ctx
+ , Cond const & cond
+ , Cases const & cases
+ , mpl::int_<1> size
+ , mpl::true_
+ ) const
+ {
+ switch(eval(cond, ctx))
+ {
+ default:
+ eval(proto::child_c<0>(cases), ctx);
+ }
+ }
+
// Bring in the evaluation functions
#include <boost/phoenix/statement/detail/switch.hpp>
};
template <typename Dummy>
struct default_actions::when<rule::switch_, Dummy>
- : proto::call<
- switch_eval(
- _context
- , proto::_child_c<0> // Cond
- , proto::_child_c<1> // Cases
- )
- >
+ : call<switch_eval>
{};
template <int N, typename A>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/throw.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/throw.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/throw.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -11,9 +11,11 @@
#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/core/actor.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/terminal.hpp>
+#include <boost/phoenix/core/value.hpp>
namespace boost { namespace phoenix
{
@@ -24,7 +26,7 @@
namespace expression
{
- template <typename A = mpl::na>
+ template <typename A>
struct throw_
: expr<tag::throw_, A>
{};
@@ -35,31 +37,17 @@
struct throw_
: expression::throw_<meta_grammar>
{};
-
- struct rethrow_
- : expression::throw_<proto::terminal<mpl::na> >
- {};
}
template <typename Dummy>
struct meta_grammar::case_<tag::throw_, Dummy>
- : proto::or_<
- enable_rule<rule::rethrow_>
- , enable_rule<rule::throw_>
- >
+ : enable_rule<rule::throw_, Dummy>
{};
struct throw_eval
{
typedef void result_type;
- template <typename Context>
- result_type
- operator()(Context& ctx) const
- {
- throw;
- }
-
template <typename Context, typename ThrowExpr>
result_type
operator()(Context& ctx, ThrowExpr const& throw_expr) const
@@ -69,27 +57,51 @@
};
template <typename Dummy>
- struct default_actions::when<rule::rethrow_, Dummy>
- : proto::call<throw_eval(_context)>
- {};
-
- template <typename Dummy>
struct default_actions::when<rule::throw_, Dummy>
- : proto::call<throw_eval(_context, proto::_child_c<0>)>
+ : call<throw_eval>
{};
- expression::throw_<>::type const
- throw_()
- {
- return expression::throw_<>::make(mpl::na());
- }
-
template <typename ThrowExpr>
typename expression::throw_<ThrowExpr>::type const
throw_(ThrowExpr const& throw_expr)
{
return expression::throw_<ThrowExpr>::make(throw_expr);
}
+
+ namespace detail
+ {
+ struct rethrow {};
+ }
+
+ namespace expression
+ {
+ struct rethrow
+ : expression::value<detail::rethrow>
+ {};
+ }
+
+ template<typename Dummy>
+ struct is_custom_terminal<detail::rethrow, Dummy>
+ : mpl::true_
+ {};
+
+ template<typename Dummy>
+ struct custom_terminal<detail::rethrow, Dummy>
+ {
+ typedef void result_type;
+
+ template <typename Context>
+ void operator()(detail::rethrow, Context &) const
+ {
+ throw;
+ }
+ };
+
+ expression::rethrow::type const
+ throw_()
+ {
+ return expression::rethrow::make(detail::rethrow());
+ }
}}
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/try_catch.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/try_catch.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/try_catch.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -11,6 +11,7 @@
#define PHOENIX_STATEMENT_TRY_CATCH_HPP
#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/is_nullary.hpp>
@@ -93,50 +94,22 @@
template <typename Dummy>
struct meta_grammar::case_<tag::try_catch, Dummy>
- : enable_rule<rule::try_catch>
+ : enable_rule<rule::try_catch, Dummy>
{};
struct try_catch_eval
{
- BOOST_PROTO_CALLABLE()
-
typedef void result_type;
// bring in the operator overloads
#include <boost/phoenix/statement/detail/try_catch_eval.hpp>
};
-
-#define PHOENIX_TRY_CATCH_CHILD(Z, N, D) proto::_child_c<N>
-#define PHOENIX_TRY_CATCH_CALL(Z, N, D) \
- proto::when< \
- expression::try_catch< \
- BOOST_PP_ENUM_PARAMS(N, proto::_ BOOST_PP_INTERCEPT) \
- > \
- , try_catch_eval( \
- _context \
- , BOOST_PP_ENUM( \
- N \
- , PHOENIX_TRY_CATCH_CHILD \
- , _ \
- ) \
- ) \
- > \
- /**/
-
+
template <typename Dummy>
struct default_actions::when<rule::try_catch, Dummy>
- : proto::or_<
- BOOST_PP_ENUM_SHIFTED(
- BOOST_PP_INC(PHOENIX_CATCH_LIMIT)
- , PHOENIX_TRY_CATCH_CALL
- , _
- )
- >
+ : call<try_catch_eval, Dummy>
{};
-#undef PHOENIX_TRY_CATCH_CHILD
-#undef PHOENIX_TRY_CATCH_CALL
-
namespace detail
{
struct try_catch_is_nullary
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/statement/while.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/statement/while.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/statement/while.hpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -9,6 +9,7 @@
#define PHOENIX_STATEMENT_WHILE_HPP
#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/call.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
@@ -26,7 +27,7 @@
template <typename Context, typename Cond, typename Do>
result_type
- operator()(Context& ctx, Cond const& cond, Do const& do_) const
+ operator()(Context const& ctx, Cond const& cond, Do const& do_) const
{
while(eval(cond, ctx))
{
@@ -37,13 +38,7 @@
template <typename Dummy>
struct default_actions::when<rule::while_, Dummy>
- : proto::call<
- while_eval(
- _context
- , proto::_child_c<0> // Cond
- , proto::_child_c<1> // Do
- )
- >
+ : call<while_eval, Dummy>
{};
template <typename Cond>
Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -136,23 +136,23 @@
[ run include/version.cpp ]
# [ run include/bind/bind_member_function.cpp ]
# [ run include/bind/bind_member_variable.cpp ]
- [ run include/core/terminal.cpp ]
- [ run include/core/nothing.cpp ]
- [ run include/core/environment.cpp ]
+ [ run include/core/actor.cpp ]
+ [ run include/core/argument.cpp ]
+ [ run include/core/arity.cpp ]
[ run include/core/domain.cpp ]
+ [ run include/core/environment.cpp ]
[ run include/core/expression.cpp ]
- [ run include/core/argument.cpp ]
[ run include/core/function_equal.cpp ]
[ run include/core/is_actor.cpp ]
- [ run include/core/arity.cpp ]
+ [ run include/core/is_nullary.cpp ]
+ [ run include/core/nothing.cpp ]
+ [ run include/core/meta_grammar.cpp ]
[ run include/core/mem_obj_ptr.cpp ]
- [ run include/core/visit_each.cpp ]
+ [ run include/core/limits.cpp ]
+ [ run include/core/terminal.cpp ]
[ run include/core/value.cpp ]
- [ run include/core/meta_grammar.cpp ]
+ [ run include/core/visit_each.cpp ]
[ run include/core/reference.cpp ]
- [ run include/core/is_nullary.cpp ]
- [ run include/core/limits.cpp ]
- [ run include/core/actor.cpp ]
[ run include/function/function.cpp : : : : function_function ]
[ run include/fusion/at.cpp ]
[ run include/object/const_cast.cpp ]
Added: sandbox/SOC/2010/phoenix3/libs/phoenix/test/include/core/call.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/include/core/call.cpp 2011-02-08 14:02:10 EST (Tue, 08 Feb 2011)
@@ -0,0 +1,12 @@
+/*==============================================================================
+ Copyright (c) 2005-2010 Joel de Guzman
+ Copyright (c) 2010 Thomas Heller
+
+ 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)
+==============================================================================*/
+
+#include <boost/phoenix/core/call.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