Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72318 - in trunk/boost/phoenix: core scope
From: thom.heller_at_[hidden]
Date: 2011-06-01 03:04:56


Author: theller
Date: 2011-06-01 03:04:55 EDT (Wed, 01 Jun 2011)
New Revision: 72318
URL: http://svn.boost.org/trac/boost/changeset/72318

Log:
[phoenix]
    - fixed nullary calculation for local variables

Text files modified:
   trunk/boost/phoenix/core/is_nullary.hpp | 64 ++++++++++++++++++++--------------------
   trunk/boost/phoenix/scope/local_variable.hpp | 4 -
   2 files changed, 33 insertions(+), 35 deletions(-)

Modified: trunk/boost/phoenix/core/is_nullary.hpp
==============================================================================
--- trunk/boost/phoenix/core/is_nullary.hpp (original)
+++ trunk/boost/phoenix/core/is_nullary.hpp 2011-06-01 03:04:55 EDT (Wed, 01 Jun 2011)
@@ -52,50 +52,50 @@
         };
     };
     
+ template <
+ typename Trait
+ , typename Expr
+ , typename State
+ , typename Data
+ , bool IsTransform = proto::is_transform<Trait>::value
+ >
+ struct is_nullary_custom_terminal_impl
+ {
+ typedef typename Trait::type result_type;
+ };
+
+ template <typename Transform, typename Expr, typename State, typename Data>
+ struct is_nullary_custom_terminal_impl<Transform, Expr, State, Data, true>
+ {
+ typedef
+ typename Transform::template impl<
+ Expr
+ , State
+ , Data
+ >::result_type
+ result_type;
+ };
+
     template <typename Dummy>
     struct is_nullary::when<rule::custom_terminal, Dummy>
     {
         BOOST_PROTO_TRANSFORM(is_nullary::when<rule::custom_terminal>)
         
         template <typename Expr, typename State, typename Data>
- struct defer_result
- : mpl::identity<
- typename result_of::is_nullary<
+ struct impl
+ : is_nullary_custom_terminal_impl<
+ result_of::is_nullary<
                     custom_terminal<
                         typename proto::detail::uncvref<
                             typename proto::result_of::value<Expr>::type
>::type
>
- >::template impl<
- typename proto::result_of::value<Expr>::type
- , State
- , Data
- >::result_type
+ >
+ , typename proto::result_of::value<Expr>::type
+ , State
+ , Data
>
         {};
-
- template <typename Expr, typename State, typename Data>
- struct impl
- {
- typedef
- typename proto::detail::uncvref<
- typename proto::result_of::value<Expr>::type
- >::type value_type;
-
- typedef
- typename result_of::is_nullary<
- custom_terminal<value_type>
- >
- is_nullary_trait;
-
- typedef
- typename mpl::eval_if_c<
- proto::is_transform<is_nullary_trait>::value
- , defer_result<Expr, State, Data>
- , is_nullary_trait
- >::type
- result_type;
- };
     };
     
     template <typename Dummy>
@@ -166,7 +166,7 @@
             template <typename Expr, typename State, typename Data>
             struct impl
             {
- typedef typename evaluator::template impl<actor<T>, State, Data>::result_type result_type;
+ typedef typename evaluator::template impl<actor<T> const, State, Data>::result_type result_type;
             };
         };
     }

Modified: trunk/boost/phoenix/scope/local_variable.hpp
==============================================================================
--- trunk/boost/phoenix/scope/local_variable.hpp (original)
+++ trunk/boost/phoenix/scope/local_variable.hpp 2011-06-01 03:04:55 EDT (Wed, 01 Jun 2011)
@@ -73,9 +73,7 @@
             : proto::or_<
                 proto::when<boost::phoenix::rule::local_variable, mpl::true_()>
               , proto::otherwise<
- boost::phoenix::result_of::is_nullary<
- boost::phoenix::custom_terminal<proto::_value>
- >()
+ is_nullary::when<boost::phoenix::rule::custom_terminal, Dummy>
>
>
         {};


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