Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55577 - trunk/boost/spirit/home/karma/detail
From: hartmut.kaiser_at_[hidden]
Date: 2009-08-13 21:11:37


Author: hkaiser
Date: 2009-08-13 21:11:37 EDT (Thu, 13 Aug 2009)
New Revision: 55577
URL: http://svn.boost.org/trac/boost/changeset/55577

Log:
Spirit: minor adjustment to output_iterator
Text files modified:
   trunk/boost/spirit/home/karma/detail/output_iterator.hpp | 19 ++++++++++++-------
   1 files changed, 12 insertions(+), 7 deletions(-)

Modified: trunk/boost/spirit/home/karma/detail/output_iterator.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/detail/output_iterator.hpp (original)
+++ trunk/boost/spirit/home/karma/detail/output_iterator.hpp 2009-08-13 21:11:37 EDT (Thu, 13 Aug 2009)
@@ -305,11 +305,14 @@
         }
 
         template <typename T>
- void output(T const& value)
+ bool output(T const& value)
         {
             // buffer characters, if appropriate
- if (NULL != buffer)
+ if (NULL != buffer) {
                 buffer->output(value);
+ return false;
+ }
+ return true;
         }
 
         bool has_buffer() const { return NULL != buffer; }
@@ -324,7 +327,10 @@
         no_buffering_policy(no_counting_policy const& rhs) {}
 
         template <typename T>
- void output(T const& value) {}
+ bool output(T const& value)
+ {
+ return true;
+ }
 
         bool has_buffer() const { return false; }
     };
@@ -352,11 +358,11 @@
         {}
 
         template <typename T>
- void output(T const& value)
+ bool output(T const& value)
         {
             this->counting_policy::output(value);
             this->tracking_policy::output(value);
- this->buffering_policy::output(value);
+ return this->buffering_policy::output(value);
         }
     };
 
@@ -446,8 +452,7 @@
         template <typename T>
         void operator=(T const& value)
         {
- this->base_iterator::output(value);
- if (!this->base_iterator::has_buffer())
+ if (this->base_iterator::output(value))
                 *sink = value;
         }
 


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