Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74878 - in trunk/boost/spirit/home: karma/nonterminal qi/nonterminal
From: joel_at_[hidden]
Date: 2011-10-10 03:39:02


Author: djowel
Date: 2011-10-10 03:38:59 EDT (Mon, 10 Oct 2011)
New Revision: 74878
URL: http://svn.boost.org/trac/boost/changeset/74878

Log:
Added rvalue support for rule %=
Text files modified:
   trunk/boost/spirit/home/karma/nonterminal/rule.hpp | 6 +++---
   trunk/boost/spirit/home/qi/nonterminal/rule.hpp | 6 +++---
   2 files changed, 6 insertions(+), 6 deletions(-)

Modified: trunk/boost/spirit/home/karma/nonterminal/rule.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/nonterminal/rule.hpp (original)
+++ trunk/boost/spirit/home/karma/nonterminal/rule.hpp 2011-10-10 03:38:59 EDT (Mon, 10 Oct 2011)
@@ -240,17 +240,17 @@
             return r;
         }
 
+#if defined(BOOST_NO_RVALUE_REFERENCES)
         // non-const version needed to suppress proto's %= kicking in
         template <typename Expr>
         friend rule& operator%=(rule& r, Expr& expr)
         {
             return r %= static_cast<Expr const&>(expr);
         }
-
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
+#else
         // for rvalue references
         template <typename Expr>
- friend rule& operator%=(rule& r, Expr const&& expr)
+ friend rule& operator%=(rule& r, Expr&& expr)
         {
             define<mpl::true_>(r, expr, traits::matches<karma::domain, Expr>());
             return r;

Modified: trunk/boost/spirit/home/qi/nonterminal/rule.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/nonterminal/rule.hpp (original)
+++ trunk/boost/spirit/home/qi/nonterminal/rule.hpp 2011-10-10 03:38:59 EDT (Mon, 10 Oct 2011)
@@ -231,17 +231,17 @@
             return r;
         }
 
+#if defined(BOOST_NO_RVALUE_REFERENCES)
         // non-const version needed to suppress proto's %= kicking in
         template <typename Expr>
         friend rule& operator%=(rule& r, Expr& expr)
         {
             return r %= static_cast<Expr const&>(expr);
         }
-
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
+#else
         // for rvalue references
         template <typename Expr>
- friend rule& operator%=(rule& r, Expr const&& expr)
+ friend rule& operator%=(rule& r, Expr&& expr)
         {
             define<mpl::true_>(r, expr, traits::matches<qi::domain, Expr>());
             return r;


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