|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66287 - in sandbox/SOC/2010/phoenix3: boost/phoenix boost/phoenix/core boost/phoenix/core/detail boost/phoenix/scope boost/phoenix/statement boost/phoenix/statement/detail libs/phoenix/test libs/phoenix/test/core libs/phoenix/test/scope
From: thom.heller_at_[hidden]
Date: 2010-10-30 16:33:48
Author: theller
Date: 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
New Revision: 66287
URL: http://svn.boost.org/trac/boost/changeset/66287
Log:
started implmentation of new extension mechanism
Added:
sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal.hpp (contents, props changed)
Text files modified:
sandbox/SOC/2010/phoenix3/boost/phoenix/core.hpp | 8
sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp | 89 +++++++++----
sandbox/SOC/2010/phoenix3/boost/phoenix/core/argument.hpp | 42 ++++++
sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_operator.hpp | 2
sandbox/SOC/2010/phoenix3/boost/phoenix/core/domain.hpp | 2
sandbox/SOC/2010/phoenix3/boost/phoenix/core/environment.hpp | 102 ++++++++++++++-
sandbox/SOC/2010/phoenix3/boost/phoenix/core/function_equal.hpp | 2
sandbox/SOC/2010/phoenix3/boost/phoenix/core/meta_grammar.hpp | 87 ++++---------
sandbox/SOC/2010/phoenix3/boost/phoenix/core/reference.hpp | 47 ++++++
sandbox/SOC/2010/phoenix3/boost/phoenix/core/value.hpp | 67 +++++++++
sandbox/SOC/2010/phoenix3/boost/phoenix/scope/lambda.hpp | 6
sandbox/SOC/2010/phoenix3/boost/phoenix/scope/let.hpp | 7
sandbox/SOC/2010/phoenix3/boost/phoenix/scope/local_variable.hpp | 1
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/detail/switch.hpp | 45 +++---
sandbox/SOC/2010/phoenix3/boost/phoenix/statement/switch.hpp | 8 -
sandbox/SOC/2010/phoenix3/libs/phoenix/test/Jamfile | 260 ++++++++++++++++++++--------------------
sandbox/SOC/2010/phoenix3/libs/phoenix/test/core/primitives_tests.cpp | 1
sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/lambda_tests.cpp | 16 +
sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/let_tests.cpp | 23 ++
19 files changed, 534 insertions(+), 281 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-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -10,13 +10,13 @@
#include <boost/phoenix/version.hpp>
#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/core/actor.hpp>
-#include <boost/phoenix/core/compose.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>
#include <boost/phoenix/core/reference.hpp>
-#include <boost/phoenix/core/nothing.hpp>
-#include <boost/phoenix/core/function_equal.hpp>
-#include <boost/phoenix/core/visit_each.hpp>
+//#include <boost/phoenix/core/nothing.hpp>
+//#include <boost/phoenix/core/function_equal.hpp>
+//#include <boost/phoenix/core/visit_each.hpp>
#endif
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-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -11,16 +11,17 @@
#include <boost/mpl/identity.hpp>
#include <boost/mpl/eval_if.hpp>
-#include <boost/phoenix/core/arity.hpp>
+/*#include <boost/phoenix/core/arity.hpp>
#include <boost/phoenix/core/compose.hpp>
#include <boost/phoenix/core/domain.hpp>
-#include <boost/phoenix/core/no_nullary.hpp>
+#include <boost/phoenix/core/no_nullary.hpp>*/
+#include <boost/phoenix/core/domain.hpp>
#include <boost/phoenix/core/environment.hpp>
#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
+#include <boost/phoenix/core/is_nullary.hpp>
#include <boost/phoenix/support/iterate.hpp>
#include <boost/proto/extends.hpp>
-#include <boost/proto/debug.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/mpl/void.hpp>
@@ -52,44 +53,68 @@
typedef typename
mpl::eval_if<
- typename no_nullary<Expr>::type//false//arity == 0 // avoid calling result_of::actor when this is false
+ typename is_nullary<Expr>::type//false//arity == 0 // avoid calling result_of::actor when this is false
+ , boost::result_of<
+ evaluator(
+ Expr const&
+ , fusion::vector2<typename make_basic_environment<>::type&, default_actions>
+ )
+ >
, mpl::identity<detail::error_expecting_arguments>
- , boost::result_of<eval_grammar(Expr const&,
- typename make_basic_environment<>::type&)>
>::type
type;
};
template <typename Expr, typename A0>
struct actor<Expr, A0>
- : boost::result_of<eval_grammar(
+ /*: boost::result_of<eval_grammar(
::boost::phoenix::actor<Expr> const &,
typename make_basic_environment<A0>::type&)
+ >*/
+ : boost::result_of<
+ evaluator(
+ Expr const&
+ , fusion::vector2<typename make_basic_environment<A0>::type&, default_actions>
+ )
>
{};
template <typename Expr, typename A0, typename A1>
struct actor<Expr, A0, A1>
- : boost::result_of<eval_grammar(
+ /*: boost::result_of<eval_grammar(
::boost::phoenix::actor<Expr> const &,
typename make_basic_environment<A0, A1>::type&)
+ >*/
+ : boost::result_of<
+ evaluator(
+ Expr const&
+ , fusion::vector2<typename make_basic_environment<A0, A1>::type&, default_actions>
+ )
>
{};
template <typename Expr, typename A0, typename A1, typename A2>
struct actor<Expr, A0, A1, A2>
- : boost::result_of<eval_grammar(
+ /*: boost::result_of<eval_grammar(
::boost::phoenix::actor<Expr> const &,
typename make_basic_environment<A0, A1, A2>::type&)
+ >*/
+ : boost::result_of<
+ evaluator(
+ Expr const&
+ , fusion::vector2<typename make_basic_environment<A0, A1, A2>::type&, default_actions>
+ )
>
{};
// Bring in the rest
- #include <boost/phoenix/core/detail/actor_result_of.hpp>
+ //#include <boost/phoenix/core/detail/actor_result_of.hpp>
}
+ /*
template <PHOENIX_typename_A_void(PHOENIX_COMPOSITE_LIMIT), typename Dummy = void>
struct actor_fun_eval;
+ */
////////////////////////////////////////////////////////////////////////////
//
@@ -116,14 +141,20 @@
: result_of::actor<Expr>
{};
*/
+ BOOST_MPL_ASSERT((proto::matches<actor<Expr>, meta_grammar>));
typename result_of::actor<Expr>::type
operator()() const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<>::type args;
- return eval(this->proto_base(), args);
+ typedef make_basic_environment<>::type params_type;
+ typedef fusion::vector2<params_type, default_actions> env_type;
+
+ env_type env(args, default_actions());
+ return eval(*this, env);
+
+ //return eval(this->proto_base(), args);
}
template <typename This, typename A0>
@@ -135,17 +166,20 @@
typename result_of::actor<Expr, A0&>::type
operator()(A0& a0) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0&>::type args(a0);
+ typedef typename make_basic_environment<A0&>::type params_type;
+ typedef fusion::vector2<params_type, default_actions> env_type;
+
+ env_type env(args, default_actions());
- return eval(*this, args);
+ return eval(*this, env);
}
+ /*
template <typename A0>
typename result_of::actor<Expr, A0 const&>::type
operator()(A0 const& a0) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0 const&>::type args(a0);
return eval(*this, args);
@@ -157,6 +191,7 @@
{
return compose<actor_fun_eval<actor<Expr>, actor<A0> >, actor<Expr>, actor<A0> >()(*this, a0);
}
+ */
template <typename This, typename A0, typename A1>
struct result<This(A0&, A1&)>
@@ -167,17 +202,20 @@
typename result_of::actor<Expr, A0&, A1&>::type
operator()(A0& a0, A1& a1) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
- typename make_basic_environment<A0&, A1&>::type args(a0, a1);
+ typedef typename make_basic_environment<A0&, A1&>::type params_type;
+ params_type args(a0, a1);
+ typedef fusion::vector2<params_type, default_actions> env_type;
- return eval(*this, args);
+ env_type env(args, default_actions());
+
+ return eval(*this, env);
}
+ /*
template <typename A0, typename A1>
typename result_of::actor<Expr, A0&, A1 const&>::type
operator()(A0& a0, A1 const& a1) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0&, A1 const&>::type args(a0, a1);
return eval(*this, args);
@@ -187,7 +225,6 @@
typename result_of::actor<Expr, A0 const&, A1&>::type
operator()(A0 const& a0, A1& a1) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0 const&, A1&>::type args(a0, a1);
return eval(*this, args);
@@ -197,7 +234,6 @@
typename result_of::actor<Expr, A0 const&, A1 const&>::type
operator()(A0 const& a0, A1 const& a1) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0 const&, A1 const&>::type args(a0, a1);
return eval(this->proto_base(), args);
@@ -227,7 +263,6 @@
typename result_of::actor<Expr, A0&, A1&, A2&>::type
operator()(A0& a0, A1& a1, A2& a2) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0&, A1&, A2&>::type args(a0, a1, a2);
return eval(*this, args);
@@ -237,7 +272,6 @@
typename result_of::actor<Expr, A0 const&, A1&, A2&>::type
operator()(A0 const& a0, A1& a1, A2& a2) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0 const&, A1&, A2&>::type args(a0, a1, a2);
return eval(*this, args);
@@ -247,7 +281,6 @@
typename result_of::actor<Expr, A0&, A1 const&, A2&>::type
operator()(A0& a0, A1 const& a1, A2& a2) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0&, A1 const&, A2&>::type args(a0, a1, a2);
return eval(*this, args);
@@ -257,7 +290,6 @@
typename result_of::actor<Expr, A0&, A1&, A2 const&>::type
operator()(A0& a0, A1& a1, A2 const& a2) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0&, A1&, A2 const&>::type args(a0, a1, a2);
return eval(*this, args);
@@ -267,7 +299,6 @@
typename result_of::actor<Expr, A0 const&, A1 const&, A2&>::type
operator()(A0 const& a0, A1 const& a1, A2& a2) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0 const&, A1 const&, A2&>::type args(a0, a1, a2);
return eval(*this, args);
@@ -277,7 +308,6 @@
typename result_of::actor<Expr, A0&, A1 const&, A2 const&>::type
operator()(A0& a0, A1 const& a1, A2 const& a2) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0&, A1 const&, A2 const&>::type args(a0, a1, a2);
return eval(*this, args);
@@ -287,7 +317,6 @@
typename result_of::actor<Expr, A0 const&, A1&, A2 const&>::type
operator()(A0 const& a0, A1& a1, A2 const& a2) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0 const&, A1&, A2 const&>::type args(a0, a1, a2);
return eval(*this, args);
@@ -297,7 +326,6 @@
typename result_of::actor<Expr, A0 const&, A1 const&, A2 const&>::type
operator()(A0 const& a0, A1 const& a1, A2 const& a2) const
{
- BOOST_PROTO_ASSERT_MATCHES( *this, eval_grammar );
typename make_basic_environment<A0 const&, A1 const&, A2 const&>::type args(a0, a1, a2);
return eval(*this, args);
@@ -320,8 +348,10 @@
// Bring in the rest
#include <boost/phoenix/core/detail/actor_operator.hpp>
+ */
};
+ /*
template <typename A0, typename A1>
struct actor_fun_eval<A0, A1>
{
@@ -393,6 +423,7 @@
// Bring in the rest ...
#include <boost/phoenix/core/detail/actor_fun_eval.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-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -9,11 +9,15 @@
#ifndef PHOENIX_CORE_ARGUMENT_HPP
#define PHOENIX_CORE_ARGUMENT_HPP
+/*
#include <boost/phoenix/core/compose.hpp>
#include <boost/phoenix/core/actor.hpp>
#include <boost/phoenix/core/no_nullary.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/environment.hpp>
+*/
+#include <boost/phoenix/core/limits.hpp>
+#include <boost/phoenix/core/actor.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
@@ -30,7 +34,44 @@
// function for evaluating argument placeholders like: _1
//
////////////////////////////////////////////////////////////////////////////
+
+ template <typename I>
+ struct argument
+ {
+ typedef I type;
+ typedef typename I::value_type value_type;
+ static value_type const value = I::value;
+ };
+
+}}
+
+namespace boost {
+ template <typename I>
+ struct is_placeholder<phoenix::argument<I> >
+ : mpl::true_
+ {};
+}
+
+namespace boost { namespace phoenix
+{
+ #define BOOST_PHOENIX_ARGUMENT_N(_, N, name) \
+ actor< \
+ proto::terminal<argument<mpl::int_<N> > >::type const \
+ > const BOOST_PP_CAT(name, BOOST_PP_INC(N)) = {};
+
+ namespace placeholders
+ {
+ BOOST_PP_REPEAT(PHOENIX_ARG_LIMIT, BOOST_PHOENIX_ARGUMENT_N, arg)
+ BOOST_PP_REPEAT(PHOENIX_ARG_LIMIT, BOOST_PHOENIX_ARGUMENT_N, _)
+ }
+
+ namespace arg_names
+ {
+ BOOST_PP_REPEAT(PHOENIX_ARG_LIMIT, BOOST_PHOENIX_ARGUMENT_N, arg)
+ BOOST_PP_REPEAT(PHOENIX_ARG_LIMIT, BOOST_PHOENIX_ARGUMENT_N, _)
+ }
+/*
namespace result_of
{
template <typename Env, typename N>
@@ -103,6 +144,7 @@
using placeholders::_2;
using placeholders::_3;
}
+*/
}}
#endif
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_operator.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_operator.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/detail/actor_operator.hpp 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -35,7 +35,6 @@
typename result_of::actor<Expr, PHOENIX_A_ref>::type
operator()(PHOENIX_A_ref_a) const
{
- BOOST_PROTO_ASSERT_MATCHES(*this, eval_grammar);
PHOENIX_ENV(PHOENIX_A_ref) args( PHOENIX_a);
return eval(*this, args);
@@ -45,7 +44,6 @@
typename result_of::actor<Expr, PHOENIX_A_const_ref>::type
operator()(PHOENIX_A_const_ref_a) const
{
- BOOST_PROTO_ASSERT_MATCHES(*this, eval_grammar);
PHOENIX_ENV(PHOENIX_A_const_ref) args( PHOENIX_a);
return eval(*this, args);
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-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -19,6 +19,8 @@
template <typename Expr>
struct actor;
+ struct meta_grammar;
+
struct phoenix_domain
: proto::domain<
proto::pod_generator<actor>,
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-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -12,12 +12,84 @@
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/phoenix/support/iterate.hpp>
#include <boost/utility/enable_if.hpp>
+#include <boost/utility/result_of.hpp>
namespace boost { namespace phoenix
{
+ namespace functional
+ {
+ template <typename N, typename Callable = proto::callable>
+ struct at
+ : proto::callable
+ {
+ typedef typename boost::remove_reference<N>::type index;
+
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename Seq>
+ struct result<This(Seq)>
+ : fusion::result_of::at_c<
+ typename boost::remove_reference<Seq>::type
+ , index::value
+ >
+ {};
+
+ template <typename Seq>
+ typename result<at(Seq &)>::type
+ operator()(Seq& seq) const
+ {
+ return fusion::at_c<index::value>(seq);
+ }
+ };
+
+ typedef at<mpl::int_<0> > args;
+ typedef at<mpl::int_<1> > actions;
+
+ struct args_at
+ : proto::callable
+ {
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename N, typename Env>
+ struct result<This(N, Env)>
+ : boost::result_of<at<N>(typename boost::result_of<args(Env)>::type)>
+ {};
+
+ template <typename N, typename Env>
+ typename result<args_at(N, Env &)>::type
+ operator()(N const &, Env& env) const
+ {
+ return at<N>()(args()(env));
+ }
+ };
+ }
+
+ struct _env
+ : proto::transform<_env>
+ {
+ template <typename Expr, typename State, typename Data>
+ struct impl
+ : proto::transform_impl<Expr, State, Data>
+ {
+ typedef fusion::vector2<State, Data> result_type;
+
+ result_type operator()(
+ typename impl::expr_param
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return fusion::vector2<State, Data>(s, d);
+ }
+ };
+ };
+
template <typename T, typename Enable = void>
struct is_environment : fusion::traits::is_sequence<T> {};
+ /*
namespace result_of
{
template <typename Env, typename N, typename Dummy = void>
@@ -63,25 +135,41 @@
//return fusion::at_c<N::value>(env);
}
};
+ */
- template <PHOENIX_typename_A_void(PHOENIX_ARG_LIMIT), typename Dummy = void>
+ template </*typename Actions,*/ PHOENIX_typename_A_void(PHOENIX_ARG_LIMIT), typename Dummy = void>
struct make_basic_environment;
+ //template <typename Actions>
template <>
- struct make_basic_environment<>
- : mpl::identity<fusion::vector0<> > {};
+ struct make_basic_environment<>//<Actions>
+ : mpl::identity<//fusion::vector2<
+ fusion::vector0<>
+ //, Actions>
+ >
+ {};
+ //template <typename Actions, typename A0>
template <typename A0>
- struct make_basic_environment<A0>
- : mpl::identity<fusion::vector1<A0> > {};
+ struct make_basic_environment</*Actions,*/ A0>
+ : mpl::identity<//fusion::vector2<
+ fusion::vector1<A0>
+ //, Actions>
+ >
+ {};
template <typename A0, typename A1>
struct make_basic_environment<A0, A1>
- : mpl::identity<fusion::vector2<A0, A1> > {};
+ : mpl::identity<//fusion::vector2<
+ fusion::vector2<A0, A1>
+ //, Actions>
+ >
+ {};
template <typename A0, typename A1, typename A2>
struct make_basic_environment<A0, A1, A2>
- : mpl::identity<fusion::vector3<A0, A1, A2> > {};
+ : mpl::identity<fusion::vector3<A0, A1, A2> >
+ {};
// Bring in the rest
#include <boost/phoenix/core/detail/make_basic_environment.hpp>
Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/function_equal.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/function_equal.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/function_equal.hpp 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -14,7 +14,7 @@
template <typename Expr1, typename Expr2>
bool function_equal_impl(actor<Expr1> const&, actor<Expr2> const&)
{
- return typeid(actor<Expr1>) == typeid(actor<Expr2>);
+ return true;//typeid(actor<Expr1>) == typeid(actor<Expr2>);
}
template <typename Expr1, typename Expr2>
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-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -1,6 +1,7 @@
/*=============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Eric Niebler
+ 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)
@@ -9,6 +10,7 @@
#define PHOENIX_CORE_META_GRAMMAR_HPP
#include <boost/mpl/deref.hpp>
+#include <boost/phoenix/core/environment.hpp>
#include <boost/proto/proto_fwd.hpp>
#include <boost/proto/matches.hpp>
#include <boost/proto/traits.hpp>
@@ -20,76 +22,41 @@
namespace boost { namespace phoenix
{
////////////////////////////////////////////////////////////////////////////
- // Our meta-grammar and expression evaluator
- ////////////////////////////////////////////////////////////////////////////
- struct eval_grammar
- : proto::switch_<struct eval_cases>
- {};
-
- ////////////////////////////////////////////////////////////////////////////
- // A function object we can call
- ////////////////////////////////////////////////////////////////////////////
- eval_grammar const eval = eval_grammar();
-
- ////////////////////////////////////////////////////////////////////////////
- // A dummy terminal that, when evaluated, returns the current state.
- ////////////////////////////////////////////////////////////////////////////
- struct env
- {};
-
- ////////////////////////////////////////////////////////////////////////////
- // Open ended grammar dispatch allows us to extend the grammar
- // without modifying the code
- ////////////////////////////////////////////////////////////////////////////
- struct eval_cases
+ // The grammar defining valid phoenix expressions
+ struct meta_grammar
+ : proto::switch_<meta_grammar>
{
- template <typename Tag>
+ template <typename Tag, typename Dummy = void>
struct case_
- : proto::or_<
- proto::when<proto::terminal<env>, proto::_state>
- , proto::otherwise<proto::_default<eval_grammar> >
- >
+ : proto::not_<proto::_>
{};
};
////////////////////////////////////////////////////////////////////////////
- // wrapper for a Fusion extension evaluator function. Keep this POD.
+ // An evaluation transform you can call to dispatch to different actions
+ struct evaluator
+ : proto::call<
+ meta_grammar(
+ proto::_
+ , functional::args(proto::_state)
+ , functional::actions(proto::_state)
+ )
+ >
+ {};
+
////////////////////////////////////////////////////////////////////////////
- template <typename Fun>
- struct funcwrap
+ // Set of default actions. Extend this whenever you add a new phoenix construct
+ struct default_actions
{
- typedef Fun type;
+ template <typename Rule, typename Dummy = void>
+ struct when
+ : proto::_default<meta_grammar>
+ {};
};
- // Handling for terminals, with the special case for env terminals.
- struct func_grammar
- : proto::or_<
- proto::when<
- proto::terminal<funcwrap<proto::_> >,
- mpl::deref<proto::_value>()
- >
- , proto::when<proto::terminal<env>, proto::_state>
- , proto::_
- >
- {};
-
- // Handling for function invocations. When _child0 is a
- // funcwrap<>, don't evaluate the other child nodes. Just
- // pass then unevaluated to the function.
- template <>
- struct eval_cases::case_<proto::tag::function>
- : proto::or_<
- proto::when<
- proto::function<
- proto::terminal<funcwrap<proto::_> >
- , proto::terminal<env>
- , proto::vararg<eval_grammar>
- >
- , proto::_default<func_grammar>
- >
- , proto::_default<eval_grammar>
- >
- {};
+ ////////////////////////////////////////////////////////////////////////////
+ // A function object we can call to evaluate our expression
+ evaluator const eval = evaluator();
}}
#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-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -8,8 +8,9 @@
#ifndef PHOENIX_CORE_REFERENCE_HPP
#define PHOENIX_CORE_REFERENCE_HPP
-#include <boost/phoenix/core/compose.hpp>
-#include <boost/phoenix/core/meta_grammar.hpp>
+#include <boost/ref.hpp>
+#include <boost/phoenix/core/actor.hpp>
+#include <boost/phoenix/core/terminal.hpp>
#include <boost/utility/result_of.hpp>
namespace boost { namespace phoenix
@@ -21,7 +22,48 @@
// function for evaluating references, e.g. ref(123)
//
////////////////////////////////////////////////////////////////////////////
+ template <typename T>
+ struct reference
+ : proto::terminal<reference_wrapper<T> >
+ {
+ typedef actor<typename proto::terminal<reference_wrapper<T> >::type const> type;
+ };
+ template <typename T>
+ typename reference<T>::type const
+ ref(T & t)
+ {
+ typename reference<T>::type const e = {{boost::ref(t)}};
+ return e;
+ };
+
+ template <typename T>
+ typename reference<T const>::type const
+ cref(T const & t)
+ {
+ typename reference<T const>::type const e = {{boost::cref(t)}};
+ return e;
+ };
+
+ // Call out boost::reference_wrapper for special handling
+ template<typename T>
+ struct is_custom_terminal<boost::reference_wrapper<T> >
+ : mpl::true_
+ {};
+
+ // Special handling for boost::reference_wrapper
+ template<typename T>
+ struct custom_terminal<boost::reference_wrapper<T> >
+ {
+ typedef T &result_type;
+
+ template <typename Env>
+ T &operator()(boost::reference_wrapper<T> r, Env &) const
+ {
+ return r;
+ }
+ };
+ /*
namespace result_of
{
template <typename Env, typename T>
@@ -70,6 +112,7 @@
{
return make_reference<T const>()(t);
}
+ */
}}
Added: sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/terminal.hpp 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -0,0 +1,62 @@
+/*==============================================================================
+ 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)
+==============================================================================*/
+#ifndef PHOENIX_CORE_TERMINAL_HPP
+#define PHOENIX_CORE_TERMINAL_HPP
+
+namespace boost
+{
+ template <typename T>
+ struct is_placeholder
+ : mpl::false_
+ {};
+}
+
+namespace boost { namespace phoenix
+{
+ template <typename T>
+ struct is_custom_terminal : mpl::false_ {};
+
+ template <typename T>
+ struct custom_terminal;
+
+ namespace rule
+ {
+ struct argument
+ : proto::if_<boost::is_placeholder<proto::_value>()>
+ {};
+
+ struct custom_terminal
+ : proto::if_<is_custom_terminal<proto::_value>()>
+ {};
+
+ struct terminal
+ : proto::terminal<proto::_>
+ {};
+ }
+
+ template <typename Dummy>
+ struct meta_grammar::case_<proto::tag::terminal, Dummy>
+ : proto::or_<
+ proto::when<rule::argument , proto::external_transform>
+ , proto::when<rule::custom_terminal, proto::external_transform>
+ , proto::when<rule::terminal , proto::external_transform>
+ >
+ {};
+
+ template <typename Dummy>
+ struct default_actions::when<rule::custom_terminal, Dummy>
+ : proto::lazy<custom_terminal<proto::_value>(proto::_value, _env)>
+ {};
+
+ template <typename Dummy>
+ struct default_actions::when<rule::argument, Dummy>
+ : proto::call<functional::args_at(proto::_value, _env)>
+ {};
+}}
+
+#endif
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-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -8,8 +8,8 @@
#ifndef PHOENIX_CORE_VALUE_HPP
#define PHOENIX_CORE_VALUE_HPP
-#include <boost/phoenix/core/compose.hpp>
-#include <boost/phoenix/core/meta_grammar.hpp>
+#include <boost/phoenix/core/actor.hpp>
+#include <boost/phoenix/core/terminal.hpp>
#include <boost/utility/result_of.hpp>
namespace boost { namespace phoenix
@@ -21,7 +21,68 @@
// function for evaluating values, e.g. val(123)
//
////////////////////////////////////////////////////////////////////////////
+
+ template <typename T>
+ struct value
+ : proto::terminal<T>
+ {
+ typedef actor<typename proto::terminal<T>::type const> type;
+ };
+
+ template <typename T, int N>
+ struct value<T[N]>
+ : proto::terminal<T>
+ {
+ typedef actor<typename proto::terminal<T const* >::type const> type;
+ };
+
+ template <typename T>
+ typename value<T>::type const
+ val(T const & t)
+ {
+ typename value<T>::type const e = {{t}};
+ return e;
+ }
+
+ template <typename T>
+ typename value<T>::type const
+ val(T & t)
+ {
+ typename value<T>::type const e = {{t}};
+ return e;
+ }
+
+ // Call out actor for special handling
+ template<typename Expr>
+ struct is_custom_terminal<actor<Expr> >
+ : mpl::true_
+ {};
+ // Special handling for actor
+ template<typename Expr>
+ struct custom_terminal<actor<Expr> >
+ {
+ template <typename Sig>
+ struct result;
+
+ template <typename This, typename Actor, typename Env>
+ struct result<This(Actor, Env)>
+ : boost::remove_reference<
+ typename boost::result_of<
+ evaluator(Actor, Env)
+ >::type
+ >
+ {};
+
+ template <typename Env>
+ typename result<custom_terminal(actor<Expr> const &, Env &)>::type
+ operator()(actor<Expr> const& expr, Env & env) const
+ {
+ return eval(expr, env);
+ }
+ };
+
+ /*
namespace result_of
{
template <typename Env, typename T>
@@ -116,7 +177,7 @@
{
return make_value<T>()(t);
}
-
+*/
}}
#endif
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 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -90,17 +90,19 @@
template <typename Vars, typename Dummy>
struct enable_nullary<lambda_actor_eval<Vars>, Dummy>
- : mpl::not_< typename mpl::fold<
+ : mpl::false_/*mpl::not_< typename mpl::fold<
Vars
, mpl::false_
, detail::compute_no_nullary
- >::type >
+ >::type >*/
{};
template <typename Expr, typename Vars, typename Map>
struct lambda_actor
{
+ lambda_actor() {}
+
lambda_actor(Expr const& expr, Vars const& vars)
: expr(expr)
, vars(vars)
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 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -62,7 +62,12 @@
return eval(expr, args);
}
};
-
+
+ template <typename Map, typename Dummy>
+ struct enable_nullary<let_eval<Map>, Dummy>
+ : mpl::true_
+ {};
+
template <typename Expr, typename Vars, typename Map>
struct make_let: compose<let_eval<Map>, Expr, Vars> {};
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 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -97,7 +97,6 @@
make_local_variable<struct _z_key>::type const _z = {};
}
-
}}
#endif
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 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -12,28 +12,6 @@
#define PHOENIX_STATEMENT_DETAIL_SWITCH_HPP
#include <boost/preprocessor/cat.hpp>
-
- template <typename Cond, typename Cases>
- struct make_switch<Cond, Cases, 1>
- {
- typedef typename result_of::case_compound<Cases, mpl::int_<0> >::type case0;
-
- typedef
- compose<
- switch_eval
- , Cond
- , case0
- >
- composite_type;
-
- typedef typename composite_type::type type;
-
- type const
- operator()( Cond const& cond, Cases const& cases) const
- {
- return composite_type()(cond, case_compound_c<0>(cases));
- }
- };
struct switch_eval
{
@@ -113,12 +91,33 @@
#undef PHOENIX_SWITCH_EVAL_OVERLOADS
};
+ template <typename Cond, typename Cases>
+ struct make_switch<Cond, Cases, 1>
+ {
+ typedef typename result_of::case_compound<Cases, mpl::int_<0> >::type case0;
+
+ typedef
+ compose<
+ switch_eval
+ , Cond
+ , case0
+ >
+ composite_type;
+
+ typedef typename composite_type::type type;
+
+ type const
+ operator()( Cond const& cond, Cases const& cases) const
+ {
+ return composite_type()(cond, case_compound_c<0>(cases));
+ }
+ };
+
#define PHOENIX_ITERATION_PARAMS \
(3, (2, PHOENIX_COMPOSITE_LIMIT, \
<boost/phoenix/statement/detail/switch.hpp>))
#include PHOENIX_ITERATE()
-
#endif
#else
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 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -11,12 +11,8 @@
#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/compose.hpp>
-#include <boost/phoenix/support/element_at.hpp>
#include <boost/phoenix/support/iterate.hpp>
#include <boost/proto/proto_fwd.hpp>
-#include <boost/proto/debug.hpp>
-#include <boost/proto/context/callable.hpp>
-#include <boost/proto/extends.hpp>
#include <boost/proto/make_expr.hpp>
namespace boost { namespace phoenix
@@ -144,8 +140,6 @@
return proto::right(case_);
}
- struct switch_eval;
-
template <
typename Cond,
typename Cases,
@@ -210,7 +204,7 @@
>::type
operator[](Cases const& cases) const
{
- BOOST_PROTO_ASSERT_MATCHES(cases, detail::switch_case_statement);
+ BOOST_MPL_ASSERT((proto::matches<Cases, detail::switch_case_statement>));
return make_switch<Cond, Cases>()(cond, cases);
}
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 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -18,164 +18,164 @@
test-suite phoenix_core :
[ run core/primitives_tests.cpp ]
- [ run core/function_composition.cpp ]
+# [ run core/function_composition.cpp ]
;
test-suite phoenix_operator :
- [ run operator/arithmetic_tests.cpp ]
- [ run operator/bitwise_tests.cpp ]
- [ run operator/comparison_tests.cpp ]
- [ run operator/if_else_tests.cpp ]
- [ run operator/io_tests.cpp ]
- [ run operator/logical_tests.cpp ]
- [ run operator/misc_binary_tests.cpp ]
- [ run operator/self_tests.cpp ]
- [ run operator/unary_tests.cpp ]
- [ run operator/member.cpp ]
+# [ run operator/arithmetic_tests.cpp ]
+# [ run operator/bitwise_tests.cpp ]
+# [ run operator/comparison_tests.cpp ]
+# [ run operator/if_else_tests.cpp ]
+# [ run operator/io_tests.cpp ]
+# [ run operator/logical_tests.cpp ]
+# [ run operator/misc_binary_tests.cpp ]
+# [ run operator/self_tests.cpp ]
+# [ run operator/unary_tests.cpp ]
+# [ run operator/member.cpp ]
;
test-suite phoenix_object :
- [ run object/cast_tests.cpp ]
- [ run object/new_delete_tests.cpp ]
+# [ run object/cast_tests.cpp ]
+# [ run object/new_delete_tests.cpp ]
;
test-suite phoenix_function :
- [ run function/function_tests.cpp ]
+# [ run function/function_tests.cpp ]
;
test-suite phoenix_bind :
- [ run bind/bind_function_tests.cpp ]
- [ run bind/bind_function_object_tests.cpp ]
- [ run bind/bind_member_function_tests.cpp ]
- [ run bind/bind_member_variable_tests.cpp ]
+# [ run bind/bind_function_tests.cpp ]
+# [ run bind/bind_function_object_tests.cpp ]
+# [ run bind/bind_member_function_tests.cpp ]
+# [ run bind/bind_member_variable_tests.cpp ]
;
test-suite phoenix_statement :
- [ run statement/if_tests.cpp ]
- [ run statement/loops_tests.cpp ]
- [ run statement/switch_tests.cpp ]
- [ run statement/exceptions.cpp ]
+# [ run statement/if_tests.cpp ]
+# [ run statement/loops_tests.cpp ]
+# [ run statement/switch_tests.cpp ]
+# [ run statement/exceptions.cpp ]
;
test-suite phoenix_container :
- [ run container/container_tests1a.cpp ]
- [ run container/container_tests1b.cpp ]
- [ run container/container_tests2a.cpp ]
- [ run container/container_tests2b.cpp ]
- [ run container/container_tests3a.cpp ]
- [ run container/container_tests3b.cpp ]
- [ run container/container_tests4a.cpp ]
- [ run container/container_tests4b.cpp ]
- [ run container/container_tests5a.cpp ]
- [ run container/container_tests5b.cpp ]
- [ run container/container_tests6a.cpp ]
- [ run container/container_tests6b.cpp ]
+# [ run container/container_tests1a.cpp ]
+# [ run container/container_tests1b.cpp ]
+# [ run container/container_tests2a.cpp ]
+# [ run container/container_tests2b.cpp ]
+# [ run container/container_tests3a.cpp ]
+# [ run container/container_tests3b.cpp ]
+# [ run container/container_tests4a.cpp ]
+# [ run container/container_tests4b.cpp ]
+# [ run container/container_tests5a.cpp ]
+# [ run container/container_tests5b.cpp ]
+# [ run container/container_tests6a.cpp ]
+# [ run container/container_tests6b.cpp ]
;
test-suite phoenix_scope :
- [ run scope/lambda_tests.cpp ]
- [ run scope/let_tests.cpp ]
- [ run scope/dynamic_tests.cpp ]
- [ run scope/bug_000008.cpp : : : $(multi-threading) ]
+# [ run scope/lambda_tests.cpp ]
+# [ run scope/let_tests.cpp ]
+# [ run scope/dynamic_tests.cpp ]
+# [ run scope/bug_000008.cpp : : : $(multi-threading) ]
;
test-suite phoenix_algorithm :
- [ run algorithm/iteration.cpp ]
- [ run algorithm/transformation1.cpp ]
- [ run algorithm/transformation2.cpp ]
- [ run algorithm/transformation3.cpp ]
- [ run algorithm/transformation4.cpp ]
- [ run algorithm/querying.cpp ]
- [ run algorithm/querying2.cpp ]
+# [ run algorithm/iteration.cpp ]
+# [ run algorithm/transformation1.cpp ]
+# [ run algorithm/transformation2.cpp ]
+# [ run algorithm/transformation3.cpp ]
+# [ run algorithm/transformation4.cpp ]
+# [ run algorithm/querying.cpp ]
+# [ run algorithm/querying2.cpp ]
;
test-suite phoenix_boost_bind_compatibility :
- [ run boost_bind_compatibility/bind_and_or_test.cpp ]
- [ run boost_bind_compatibility/bind_cdecl_mf_test.cpp ]
- [ run boost_bind_compatibility/bind_const_test.cpp ]
- [ run boost_bind_compatibility/bind_cv_test.cpp ] # problem: only const operator() overloads are regarded
- [ run boost_bind_compatibility/bind_dm_test.cpp ]
- [ run boost_bind_compatibility/bind_dm2_test.cpp ]
- [ run boost_bind_compatibility/bind_dm3_test.cpp ]
- [ run boost_bind_compatibility/bind_eq_test.cpp ] # problem: binary visitation of AST for equality test not implemented
- [ run boost_bind_compatibility/bind_eq2_test.cpp ]
- [ run boost_bind_compatibility/bind_eq3_test.cpp ]
- #[ run boost_bind_compatibility/bind_fastcall_mf_test.cpp ] # problem: result_of can't handle the fastcall attribute
- #[ run boost_bind_compatibility/bind_fastcall_test.cpp ] # problem: result_of can't handle the fastcall attribute
- [ run boost_bind_compatibility/bind_fn2_test.cpp ]
- [ run boost_bind_compatibility/bind_function_test.cpp ] # problem: fn.contains not working properly
- [ run boost_bind_compatibility/bind_mf2_test.cpp ]
- [ run boost_bind_compatibility/bind_not_test.cpp ]
- [ run boost_bind_compatibility/bind_placeholder_test.cpp ] # problem: real custom placeholders, like in the original test not implemented yet
- [ run boost_bind_compatibility/bind_ref_test.cpp ]
- [ run boost_bind_compatibility/bind_rel_test.cpp ]
- [ run boost_bind_compatibility/bind_rvalue_test.cpp ]
- [ run boost_bind_compatibility/bind_rv_sp_test.cpp ]
- [ run boost_bind_compatibility/bind_stateful_test.cpp ] # problem: only const operator() overloads are regarded
- #[ run boost_bind_compatibility/bind_stdcall_mf_test.cpp ] # problem: result_of can't handle the stdcall attribute
- #[ run boost_bind_compatibility/bind_stdcall_test.cpp ] # problem: result_of can't handle the stdcall attribute
- [ run boost_bind_compatibility/bind_test.cpp ]
+# [ run boost_bind_compatibility/bind_and_or_test.cpp ]
+# [ run boost_bind_compatibility/bind_cdecl_mf_test.cpp ]
+# [ run boost_bind_compatibility/bind_const_test.cpp ]
+# [ run boost_bind_compatibility/bind_cv_test.cpp ] # problem: only const operator() overloads are regarded
+# [ run boost_bind_compatibility/bind_dm_test.cpp ]
+# [ run boost_bind_compatibility/bind_dm2_test.cpp ]
+# [ run boost_bind_compatibility/bind_dm3_test.cpp ]
+# [ run boost_bind_compatibility/bind_eq_test.cpp ] # problem: binary visitation of AST for equality test not implemented
+# [ run boost_bind_compatibility/bind_eq2_test.cpp ]
+# [ run boost_bind_compatibility/bind_eq3_test.cpp ]
+# #[ run boost_bind_compatibility/bind_fastcall_mf_test.cpp ] # problem: result_of can't handle the fastcall attribute
+# #[ run boost_bind_compatibility/bind_fastcall_test.cpp ] # problem: result_of can't handle the fastcall attribute
+# [ run boost_bind_compatibility/bind_fn2_test.cpp ]
+# [ run boost_bind_compatibility/bind_function_test.cpp ] # problem: fn.contains not working properly
+# [ run boost_bind_compatibility/bind_mf2_test.cpp ]
+# [ run boost_bind_compatibility/bind_not_test.cpp ]
+# [ run boost_bind_compatibility/bind_placeholder_test.cpp ] # problem: real custom placeholders, like in the original test not implemented yet
+# [ run boost_bind_compatibility/bind_ref_test.cpp ]
+# [ run boost_bind_compatibility/bind_rel_test.cpp ]
+# [ run boost_bind_compatibility/bind_rvalue_test.cpp ]
+# [ run boost_bind_compatibility/bind_rv_sp_test.cpp ]
+# [ run boost_bind_compatibility/bind_stateful_test.cpp ] # problem: only const operator() overloads are regarded
+# #[ run boost_bind_compatibility/bind_stdcall_mf_test.cpp ] # problem: result_of can't handle the stdcall attribute
+# #[ run boost_bind_compatibility/bind_stdcall_test.cpp ] # problem: result_of can't handle the stdcall attribute
+# [ run boost_bind_compatibility/bind_test.cpp ]
;
test-suite phoenix_include :
- [ run include/bind_bind.cpp ]
- #[ run include/bind_bind_member_function.cpp ]
- #[ run include/bind_bind_member_variable.cpp ]
- [ run include/bind.cpp ]
- [ run include/core_actor.cpp ]
- [ run include/core_argument.cpp ]
- [ run include/core_arity.cpp ]
- [ run include/core_compose.cpp ]
- [ run include/core.cpp ]
- [ run include/core_domain.cpp ]
- [ run include/core_environment.cpp ]
- [ run include/core_is_actor.cpp ]
- [ run include/core_limits.cpp ]
- [ run include/core_mem_obj_ptr.cpp ]
- [ run include/core_meta_grammar.cpp ]
- [ run include/core_no_nullary.cpp ]
- [ run include/core_nothing.cpp ]
- [ run include/core_reference.cpp ]
- [ run include/core_value.cpp ]
- [ run include/function.cpp ]
- [ run include/function_function.cpp ]
- [ run include/fusion_at.cpp ]
- [ run include/fusion.cpp ]
- [ run include/object_const_cast.cpp ]
- [ run include/object_construct.cpp ]
- [ run include/object.cpp ]
- [ run include/object_delete.cpp ]
- [ run include/object_dynamic_cast.cpp ]
- [ run include/object_new.cpp ]
- [ run include/object_reinterpret_cast.cpp ]
- [ run include/object_static_cast.cpp ]
- [ run include/operator.cpp ]
- [ run include/operator_if_else.cpp ]
- [ run include/operator_io.cpp ]
- #[ run include/operator_member.cpp ]
- [ run include/operator_operator.cpp ]
- [ run include/scope.cpp ]
- [ run include/scope_dynamic.cpp ]
- [ run include/scope_lambda.cpp ]
- [ run include/scope_let.cpp ]
- [ run include/scope_local_variable.cpp ]
- [ run include/scope_scoped_environment.cpp ]
- [ run include/statement.cpp ]
- [ run include/statement_do_while.cpp ]
- [ run include/statement_for.cpp ]
- [ run include/statement_if.cpp ]
- [ run include/statement_switch.cpp ]
- [ run include/statement_throw.cpp ]
- [ run include/statement_try_catch.cpp ]
- [ run include/statement_while.cpp ]
- [ run include/stl_algorithm.cpp ]
- [ run include/stl_algorithm_iteration.cpp ]
- [ run include/stl_algorithm_querying.cpp ]
- [ run include/stl_algorithm_transformation.cpp ]
- [ run include/stl_container_container.cpp ]
- [ run include/stl_container.cpp ]
- [ run include/stl.cpp ]
- [ run include/support_element_at.cpp ]
- [ run include/support_iterate.cpp ]
- [ run include/version.cpp ]
+# [ run include/bind_bind.cpp ]
+# #[ run include/bind_bind_member_function.cpp ]
+# #[ run include/bind_bind_member_variable.cpp ]
+# [ run include/bind.cpp ]
+# [ run include/core_actor.cpp ]
+# [ run include/core_argument.cpp ]
+# [ run include/core_arity.cpp ]
+# [ run include/core_compose.cpp ]
+# [ run include/core.cpp ]
+# [ run include/core_domain.cpp ]
+# [ run include/core_environment.cpp ]
+# [ run include/core_is_actor.cpp ]
+# [ run include/core_limits.cpp ]
+# [ run include/core_mem_obj_ptr.cpp ]
+# [ run include/core_meta_grammar.cpp ]
+# [ run include/core_no_nullary.cpp ]
+# [ run include/core_nothing.cpp ]
+# [ run include/core_reference.cpp ]
+# [ run include/core_value.cpp ]
+# [ run include/function.cpp ]
+# [ run include/function_function.cpp ]
+# [ run include/fusion_at.cpp ]
+# [ run include/fusion.cpp ]
+# [ run include/object_const_cast.cpp ]
+# [ run include/object_construct.cpp ]
+# [ run include/object.cpp ]
+# [ run include/object_delete.cpp ]
+# [ run include/object_dynamic_cast.cpp ]
+# [ run include/object_new.cpp ]
+# [ run include/object_reinterpret_cast.cpp ]
+# [ run include/object_static_cast.cpp ]
+# [ run include/operator.cpp ]
+# [ run include/operator_if_else.cpp ]
+# [ run include/operator_io.cpp ]
+# #[ run include/operator_member.cpp ]
+# [ run include/operator_operator.cpp ]
+# [ run include/scope.cpp ]
+# [ run include/scope_dynamic.cpp ]
+# [ run include/scope_lambda.cpp ]
+# [ run include/scope_let.cpp ]
+# [ run include/scope_local_variable.cpp ]
+# [ run include/scope_scoped_environment.cpp ]
+# [ run include/statement.cpp ]
+# [ run include/statement_do_while.cpp ]
+# [ run include/statement_for.cpp ]
+# [ run include/statement_if.cpp ]
+# [ run include/statement_switch.cpp ]
+# [ run include/statement_throw.cpp ]
+# [ run include/statement_try_catch.cpp ]
+# [ run include/statement_while.cpp ]
+# [ run include/stl_algorithm.cpp ]
+# [ run include/stl_algorithm_iteration.cpp ]
+# [ run include/stl_algorithm_querying.cpp ]
+# [ run include/stl_algorithm_transformation.cpp ]
+# [ run include/stl_container_container.cpp ]
+# [ run include/stl_container.cpp ]
+# [ run include/stl.cpp ]
+# [ run include/support_element_at.cpp ]
+# [ run include/support_iterate.cpp ]
+# [ run include/version.cpp ]
;
Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/core/primitives_tests.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/core/primitives_tests.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/core/primitives_tests.cpp 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -7,6 +7,7 @@
#include <iostream>
#include <string>
+#include <boost/proto/proto.hpp>
#include <boost/phoenix/core.hpp>
#include <boost/detail/lightweight_test.hpp>
Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/lambda_tests.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/lambda_tests.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/lambda_tests.cpp 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -9,6 +9,8 @@
#include <algorithm>
#include <vector>
+#include <typeinfo>
+
#define PHOENIX_LIMIT 5
#include <boost/detail/lightweight_test.hpp>
@@ -73,7 +75,7 @@
using boost::phoenix::local_names::_a;
using boost::phoenix::local_names::_b;
using boost::phoenix::placeholders::arg1;
-
+/*
{
int x = 1;
int y = lambda[_1]()(x);
@@ -100,15 +102,19 @@
(x, z)(y) == x + y + z
);
}
-
+*/
{
int x = 4;
int y = 5;
- lambda(_a = _1)[_a = 555](x)();
+ //lambda(_a = _1)[_a = 555](x)();
+
+ std::cout << typeid(lambda(_a = _1)[_a = 555](x)()).name() << "\n";
+ std::cout << typeid(lambda(_a = _1)[_a = 555](x)(0)).name() << "\n";
+
BOOST_TEST(x == 555);
(void)y;
}
-
+/*
{
int x = 1;
long x2 = 2;
@@ -193,7 +199,7 @@
//lambda[let(_a = _1)[_a = _2]]()(i, 2);
BOOST_TEST(i == 2);
}
-
+*/
return boost::report_errors();
}
Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/let_tests.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/let_tests.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/test/scope/let_tests.cpp 2010-10-30 16:33:43 EDT (Sat, 30 Oct 2010)
@@ -18,6 +18,7 @@
#include <boost/phoenix/function.hpp>
#include <boost/phoenix/fusion.hpp>
+#include <typeinfo>
int
main()
@@ -36,7 +37,7 @@
using boost::phoenix::local_names::_y;
using boost::phoenix::local_names::_z;
using boost::phoenix::placeholders::arg1;
-
+/*
{
int x = 1;
BOOST_TEST(
@@ -113,7 +114,7 @@
BOOST_TEST(x == 999);
}
-
+ */
{
// FIXME do not require a argument to return int
BOOST_TEST(
@@ -123,8 +124,22 @@
]
(0) == 1 + 2 + 3 + 4 + 5
);
+ std::cout << typeid(
+ let(_a = 1, _b = 2, _c = 3, _d = 4, _e = 5)
+ [
+ _a + _b + _c + _d + _e
+ ]
+ ()
+ ).name() << "\n";
+ std::cout << typeid(
+ let(_a = 1, _b = 2, _c = 3, _d = 4, _e = 5)
+ [
+ _a + _b + _c + _d + _e
+ ]
+ (0)
+ ).name() << "\n";
}
-
+ /*
#ifdef PHOENIX_SHOULD_NOT_COMPILE_TEST
{
// disallow this:
@@ -169,7 +184,7 @@
let(_a = _1)[_a = _2](i, 2);
BOOST_TEST(i == 2);
}
-
+*/
return boost::report_errors();
}
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