Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53084 - trunk/boost/spirit/home/qi/nonterminal
From: hartmut.kaiser_at_[hidden]
Date: 2009-05-18 07:35:58


Author: hkaiser
Date: 2009-05-18 07:35:57 EDT (Mon, 18 May 2009)
New Revision: 53084
URL: http://svn.boost.org/trac/boost/changeset/53084

Log:
Spirit: Added assertion avoiding assigning uninitialized rules.
Text files modified:
   trunk/boost/spirit/home/qi/nonterminal/rule.hpp | 6 ++++++
   1 files changed, 6 insertions(+), 0 deletions(-)

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 2009-05-18 07:35:57 EDT (Mon, 18 May 2009)
@@ -183,6 +183,12 @@
 
         rule& operator=(rule const& rhs)
         {
+ // The following assertion fires when you try to initialize a rule
+ // from an uninitialized one. Did you mean to refer to the right
+ // hand side rule instead of assigning from it? In this case you
+ // should write lhs = rhs.alias();
+ BOOST_ASSERT(rhs.f);
+
             f = rhs.f;
             name_ = rhs.name_;
             return *this;


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