Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71203 - trunk/boost/phoenix/core
From: thom.heller_at_[hidden]
Date: 2011-04-12 11:54:58


Author: theller
Date: 2011-04-12 11:54:57 EDT (Tue, 12 Apr 2011)
New Revision: 71203
URL: http://svn.boost.org/trac/boost/changeset/71203

Log:
[phoenix]

  - fixed dangling reference int operator[] expression template creation

Text files modified:
   trunk/boost/phoenix/core/actor.hpp | 32 ++++++++++++++++++++++++++++----
   1 files changed, 28 insertions(+), 4 deletions(-)

Modified: trunk/boost/phoenix/core/actor.hpp
==============================================================================
--- trunk/boost/phoenix/core/actor.hpp (original)
+++ trunk/boost/phoenix/core/actor.hpp 2011-04-12 11:54:57 EDT (Tue, 12 Apr 2011)
@@ -150,7 +150,7 @@
           , phoenix_domain
           , proto_base_expr
           , A0
- >::type
+ >::type const
         operator=(A0 const & a0) const
         {
             return proto::make_expr<proto::tag::assign, phoenix_domain>(this->proto_expr_, a0);
@@ -162,14 +162,38 @@
           , phoenix_domain
           , proto_base_expr
           , A0
- >::type
+ >::type const
         operator=(A0 & a0) const
         {
             return proto::make_expr<proto::tag::assign, phoenix_domain>(this->proto_expr_, a0);
         }
+
+ template <typename A0>
+ typename proto::result_of::make_expr<
+ proto::tag::subscript
+ , phoenix_domain
+ , proto_base_expr
+ , A0
+ >::type const
+ operator[](A0 const & a0) const
+ {
+ return proto::make_expr<proto::tag::subscript, phoenix_domain>(this->proto_expr_, a0);
+ }
+
+ template <typename A0>
+ typename proto::result_of::make_expr<
+ proto::tag::subscript
+ , phoenix_domain
+ , proto_base_expr
+ , A0
+ >::type const
+ operator[](A0 & a0) const
+ {
+ return proto::make_expr<proto::tag::subscript, phoenix_domain>(this->proto_expr_, a0);
+ }
 
         //BOOST_PROTO_EXTENDS_ASSIGN_()
- BOOST_PROTO_EXTENDS_SUBSCRIPT()
+ //BOOST_PROTO_EXTENDS_SUBSCRIPT()
 
         template <typename Sig>
         struct result;
@@ -222,7 +246,7 @@
     
     template <typename Expr>
     struct result_of<phoenix::actor<Expr> const()>
- : result_of<phoenix::actor<typename phoenix::actor<Expr>::proto_base_expr>()>
+ : phoenix::result_of::actor<typename phoenix::actor<Expr>::proto_base_expr>
     {};
 }
 


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