|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71745 - in trunk/boost/phoenix: core scope stl/algorithm
From: thom.heller_at_[hidden]
Date: 2011-05-05 15:23:28
Author: theller
Date: 2011-05-05 15:23:27 EDT (Thu, 05 May 2011)
New Revision: 71745
URL: http://svn.boost.org/trac/boost/changeset/71745
Log:
[phoenix] fixed some limits and scope
Text files modified:
trunk/boost/phoenix/core/limits.hpp | 20 ++++++++++----------
trunk/boost/phoenix/scope/let.hpp | 7 ++++++-
trunk/boost/phoenix/scope/this.hpp | 36 +++++++++++++++++++++---------------
trunk/boost/phoenix/stl/algorithm/querying.hpp | 1 +
4 files changed, 38 insertions(+), 26 deletions(-)
Modified: trunk/boost/phoenix/core/limits.hpp
==============================================================================
--- trunk/boost/phoenix/core/limits.hpp (original)
+++ trunk/boost/phoenix/core/limits.hpp 2011-05-05 15:23:27 EDT (Thu, 05 May 2011)
@@ -96,12 +96,12 @@
#if !defined(BOOST_PROTO_MAX_ARITY)
# define BOOST_PROTO_MAX_ARITY BOOST_PP_INC(BOOST_PHOENIX_COMPOSITE_LIMIT)
-# if defined(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
-# undef BOOST_MPL_LIMIT_METAFUNCTION_ARITY
-# endif
-# define BOOST_MPL_LIMIT_METAFUNCTION_ARITY BOOST_PP_INC(BOOST_PROTO_MAX_ARITY)
+# if !defined(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
+# define BOOST_MPL_LIMIT_METAFUNCTION_ARITY BOOST_PP_INC(BOOST_PROTO_MAX_ARITY)
//# define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
-//# endif
+# elif BOOST_MPL_LIMIT_METAFUNCTION_ARITY < BOOST_PROTO_MAX_ARITY
+# error "BOOST_MPL_LIMIT_METAFUNCTION_ARITY < BOOST_PROTO_MAX_ARITY"
+# endif
#elif (BOOST_PROTO_MAX_ARITY < BOOST_PHOENIX_COMPOSE_LIMIT)
# error "BOOST_PROTO_MAX_ARITY < BOOST_PHOENIX_COMPOSITE_LIMIT"
#endif
@@ -112,11 +112,11 @@
# error "BOOST_PROTO_MAX_LOGICAL_ARITY < BOOST_PHOENIX_COMPOSITE_LIMIT"
#endif
-#if !defined(BOOST_RESULT_OF_NUM_ARGS)
-# define BOOST_RESULT_OF_NUM_ARGS BOOST_PP_INC(BOOST_PHOENIX_COMPOSITE_LIMIT)
-#elif BOOST_RESULT_OF_NUM_ARGS < BOOST_PP_INC(BOOST_PHOENIX_COMPOSITE_LIMIT)
-# error "BOOST_RESULT_OF_NUM_ARGS < BOOST_PHOENIX_COMPOSITE_LIMIT + 1"
-#endif
+//#if !defined(BOOST_RESULT_OF_NUM_ARGS)
+//# define BOOST_RESULT_OF_NUM_ARGS BOOST_PP_INC(BOOST_PHOENIX_COMPOSITE_LIMIT)
+//#elif BOOST_RESULT_OF_NUM_ARGS < BOOST_PP_INC(BOOST_PHOENIX_COMPOSITE_LIMIT)
+//# error "BOOST_RESULT_OF_NUM_ARGS < BOOST_PHOENIX_COMPOSITE_LIMIT + 1"
+//#endif
// this include will set the limit for the proto expression arity
#include <boost/proto/proto_fwd.hpp>
Modified: trunk/boost/phoenix/scope/let.hpp
==============================================================================
--- trunk/boost/phoenix/scope/let.hpp (original)
+++ trunk/boost/phoenix/scope/let.hpp 2011-05-05 15:23:27 EDT (Thu, 05 May 2011)
@@ -33,7 +33,12 @@
struct result;
template <typename This, typename Locals, typename Let, typename Context>
- struct result<This(Locals const &, Let const &, Context)>
+ struct result<This(Locals, Let, Context)>
+ : result<This(Locals const &, Let const &, Context)>
+ {};
+
+ template <typename This, typename Locals, typename Let, typename Context>
+ struct result<This(Locals &, Let &, Context)>
{
typedef
typename result_of::actions<Context>::type
Modified: trunk/boost/phoenix/scope/this.hpp
==============================================================================
--- trunk/boost/phoenix/scope/this.hpp (original)
+++ trunk/boost/phoenix/scope/this.hpp 2011-05-05 15:23:27 EDT (Thu, 05 May 2011)
@@ -14,24 +14,28 @@
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/terminal.hpp>
+#include <boost/phoenix/scope/lambda.hpp>
#include <boost/type_traits/remove_pointer.hpp>
+/*
BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG(
(boost)(phoenix)(this_function)
, (meta_grammar)(meta_grammar)
, BOOST_PHOENIX_LIMIT
)
+*/
namespace boost { namespace phoenix {
-
+ /*
template <typename Expr>
struct this_actor;
+ */
namespace detail
{
template <typename Dummy>
struct this_placeholder {};
-
+ /*
struct infinite_recursion_detected {};
struct last_non_this_actor
@@ -55,8 +59,9 @@
>
>
{};
+ */
}
-
+#if 0
struct this_function_eval
{
BOOST_PROTO_CALLABLE()
@@ -72,6 +77,8 @@
template <typename This, typename T, typename T0, typename Context>
struct result<This(T &, T0 &, Context &)>
{
+ typedef void type;
+ /*
typedef
typename evaluator::impl<T &, Context &, int>::result_type
this_type;
@@ -87,6 +94,7 @@
typename boost::result_of<typename proto::detail::uncvref<checker>::type(arg0_type)>::type
>::type
type;
+ */
};
template <typename This, typename T, typename T0, typename T1, typename Context>
@@ -97,6 +105,8 @@
template <typename This, typename T, typename T0, typename T1, typename Context>
struct result<This(T &, T0 &, T1 &, Context &)>
{
+ typedef void type;
+ /*
typedef
typename evaluator::impl<T &, Context &, int>::result_type
this_type;
@@ -116,15 +126,16 @@
typename boost::result_of<typename proto::detail::uncvref<checker>::type(arg0_type, arg1_type)>::type
>::type
type;
+ */
};
template <typename This, typename T0, typename Context>
typename result<this_function_eval(This const&, T0 const&, Context &)>::type
- operator()(This const& _this, T0 const & t0, Context & ctx) const
+ operator()(This const& _this, T0 const & t0, Context const & ctx) const
{
- typedef typename evaluator::impl<This const&, Context &, int>::result_type this_type;
- typedef typename detail::last_non_this_actor::impl<this_type, int, int>::result_type checker;
+ //typedef typename evaluator::impl<This const&, Context &, int>::result_type this_type;
+ //typedef typename detail::last_non_this_actor::impl<this_type, int, int>::result_type checker;
//std::cout << typeid(checker).name() << "\n";
//std::cout << typeid(checker).name() << "\n";
@@ -134,14 +145,9 @@
template <typename This, typename T0, typename T1, typename Context>
typename result<this_function_eval(This const&, T0 const&, T1 const&, Context)>::type
- operator()(This const& _this, T0 const & t0, T1 const & t1, Context & ctx) const
+ operator()(This const& this_, T0 const & t0, T1 const & t1, Context const & ctx) const
{
- typedef typename evaluator::impl<This const&, Context &, int>::result_type this_type;
- typedef typename detail::last_non_this_actor::impl<this_type, int, int>::result_type checker;
-
- //std::cout << typeid(checker).name() << "\n";
-
- return boost::phoenix::eval(_this, ctx)(boost::phoenix::eval(t0, ctx), boost::phoenix::eval(t1, ctx));
+ return boost::phoenix::eval(this_, ctx)(boost::phoenix::eval(t0, ctx), boost::phoenix::eval(t1, ctx));
}
};
@@ -183,7 +189,7 @@
return expression::this_function<this_actor, T0, T1>::make(*this, t0, t1);
}
};
-
+#endif
template <typename D>
struct is_custom_terminal<detail::this_placeholder<D> >
@@ -230,7 +236,7 @@
: proto::terminal<detail::this_placeholder<void> >
{
typedef proto::terminal<detail::this_placeholder<void> >::type base_type;
- typedef this_actor<base_type> type;
+ typedef actor<base_type> type;
static const type make()
{
Modified: trunk/boost/phoenix/stl/algorithm/querying.hpp
==============================================================================
--- trunk/boost/phoenix/stl/algorithm/querying.hpp (original)
+++ trunk/boost/phoenix/stl/algorithm/querying.hpp 2011-05-05 15:23:27 EDT (Thu, 05 May 2011)
@@ -14,6 +14,7 @@
#include <algorithm>
+#include <boost/phoenix/core/limits.hpp>
#include <boost/phoenix/stl/algorithm/detail/has_find.hpp>
#include <boost/phoenix/stl/algorithm/detail/has_lower_bound.hpp>
#include <boost/phoenix/stl/algorithm/detail/has_upper_bound.hpp>
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