Boost logo

Boost-Commit :

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


Author: djowel
Date: 2011-10-10 02:07:35 EDT (Mon, 10 Oct 2011)
New Revision: 74876
URL: http://svn.boost.org/trac/boost/changeset/74876

Log:
Added rvalue support for rule %=
Text files modified:
   trunk/boost/spirit/home/karma/nonterminal/rule.hpp | 11 +++++++++++
   trunk/boost/spirit/home/qi/nonterminal/rule.hpp | 11 +++++++++++
   2 files changed, 22 insertions(+), 0 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 02:07:35 EDT (Mon, 10 Oct 2011)
@@ -246,6 +246,17 @@
         {
             return r %= static_cast<Expr const&>(expr);
         }
+
+#if !defined(BOOST_NO_RVALUE_REFERENCES)
+ // for rvalue references
+ template <typename Expr>
+ friend rule& operator%=(rule& r, Expr&& expr)
+ {
+ define<mpl::true_>(r, expr, traits::matches<karma::domain, Expr>());
+ return r;
+ }
+#endif
+
 #else
         // both friend functions have to be defined out of class as VC7.1
         // will complain otherwise

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 02:07:35 EDT (Mon, 10 Oct 2011)
@@ -237,6 +237,17 @@
         {
             return r %= static_cast<Expr const&>(expr);
         }
+
+#if !defined(BOOST_NO_RVALUE_REFERENCES)
+ // for rvalue references
+ template <typename Expr>
+ friend rule& operator%=(rule& r, Expr&& expr)
+ {
+ define<mpl::true_>(r, expr, traits::matches<qi::domain, Expr>());
+ return r;
+ }
+#endif
+
 #else
         // both friend functions have to be defined out of class as VC7.1
         // will complain otherwise


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