Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83927 - in branches/release: . boost boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/karma/stream
From: hartmut.kaiser_at_[hidden]
Date: 2013-04-16 08:48:05


Author: hkaiser
Date: 2013-04-16 08:48:05 EDT (Tue, 16 Apr 2013)
New Revision: 83927
URL: http://svn.boost.org/trac/boost/changeset/83927

Log:
Spirit: Merging from trunk
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/spirit/ (props changed)
   branches/release/boost/spirit/home/ (props changed)
   branches/release/boost/spirit/home/karma/ (props changed)
Text files modified:
   branches/release/boost/spirit/home/karma/stream/stream.hpp | 44 +++++++++++++++++++++++----------------
   1 files changed, 26 insertions(+), 18 deletions(-)

Modified: branches/release/boost/spirit/home/karma/stream/stream.hpp
==============================================================================
--- branches/release/boost/spirit/home/karma/stream/stream.hpp (original)
+++ branches/release/boost/spirit/home/karma/stream/stream.hpp 2013-04-16 08:48:05 EDT (Tue, 16 Apr 2013)
@@ -142,12 +142,15 @@
             // use existing operator<<()
             typedef typename attribute<Context>::type attribute_type;
 
- boost::iostreams::stream<sink_device> ostr(sink);
- ostr << traits::extract_from<attribute_type>(attr, context) << std::flush;
+ {
+ boost::iostreams::stream<sink_device> ostr(sink);
+ ostr << traits::extract_from<attribute_type>(attr, context) << std::flush;
+
+ if (!ostr.good())
+ return false;
+ }
 
- if (ostr.good())
- return karma::delimit_out(sink, d); // always do post-delimiting
- return false;
+ return karma::delimit_out(sink, d); // always do post-delimiting
         }
 
         // this is a special overload to detect if the output iterator has been
@@ -175,14 +178,16 @@
             // use existing operator<<()
             typedef typename attribute<Context>::type attribute_type;
 
- boost::iostreams::stream<sink_device> ostr(sink);
- ostr.imbue(sink.get_ostream().getloc());
- ostr << traits::extract_from<attribute_type>(attr, context)
- << std::flush;
+ {
+ boost::iostreams::stream<sink_device> ostr(sink);
+ ostr.imbue(sink.get_ostream().getloc());
+ ostr << traits::extract_from<attribute_type>(attr, context)
+ << std::flush;
+ if (!ostr.good())
+ return false;
+ }
 
- if (ostr.good())
- return karma::delimit_out(sink, d); // always do post-delimiting
- return false;
+ return karma::delimit_out(sink, d); // always do post-delimiting
         }
 
         // this any_stream has no parameter attached, it needs to have been
@@ -260,13 +265,16 @@
                 output_iterator, Char, CharEncoding, Tag
> sink_device;
 
- boost::iostreams::stream<sink_device> ostr(sink);
- ostr.imbue(sink.get_ostream().getloc());
- ostr << t_ << std::flush; // use existing operator<<()
+ {
+ boost::iostreams::stream<sink_device> ostr(sink);
+ ostr.imbue(sink.get_ostream().getloc());
+ ostr << t_ << std::flush; // use existing operator<<()
+
+ if (!ostr.good())
+ return false;
+ }
 
- if (ostr.good())
- return karma::delimit_out(sink, d); // always do post-delimiting
- return false;
+ return karma::delimit_out(sink, d); // always do post-delimiting
         }
 
         template <typename Context>


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