|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60180 - trunk/boost/spirit/home/karma/detail
From: hartmut.kaiser_at_[hidden]
Date: 2010-03-05 07:30:14
Author: hkaiser
Date: 2010-03-05 07:30:14 EST (Fri, 05 Mar 2010)
New Revision: 60180
URL: http://svn.boost.org/trac/boost/changeset/60180
Log:
Spirit: fixed Karma output_iterator not to be noncopyable anymore.
Text files modified:
trunk/boost/spirit/home/karma/detail/output_iterator.hpp | 23 +++++++++--------------
1 files changed, 9 insertions(+), 14 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 2010-03-05 07:30:14 EST (Fri, 05 Mar 2010)
@@ -368,7 +368,6 @@
template <typename OutputIterator, typename Properties, typename Derived>
class output_iterator
: public make_output_iterator<OutputIterator, Properties, Derived>::type
- , boost::noncopyable
{
private:
// base iterator type
@@ -383,24 +382,24 @@
typedef void reference;
explicit output_iterator(OutputIterator& sink_)
- : sink(sink_)
+ : sink(&sink_)
{}
output_iterator(output_iterator const& rhs)
- : base_iterator(rhs), boost::noncopyable(), sink(rhs.sink)
+ : base_iterator(rhs), sink(rhs.sink)
{}
output_iterator& operator*() { return *this; }
output_iterator& operator++()
{
if (!this->base_iterator::has_buffer())
- ++sink; // increment only if not buffering
+ ++(*sink); // increment only if not buffering
return *this;
}
output_iterator operator++(int)
{
if (!this->base_iterator::has_buffer()) {
output_iterator t(*this);
- ++sink;
+ ++(*sink);
return t;
}
return *this;
@@ -415,7 +414,7 @@
void operator=(T const& value)
{
if (this->base_iterator::output(value))
- *sink = value;
+ *(*sink) = value;
}
#if defined(BOOST_MSVC)
#pragma warning (pop)
@@ -426,11 +425,7 @@
protected:
// this is the wrapped user supplied output iterator
- OutputIterator& sink;
-
- private:
- // suppress warning about assignment operator not being generated
- output_iterator& operator=(output_iterator const&);
+ OutputIterator* sink;
};
///////////////////////////////////////////////////////////////////////////
@@ -450,11 +445,11 @@
output_iterator(base_iterator_type& sink)
: base_type(sink) {}
- ostream_type& get_ostream() { return this->sink.get_ostream(); }
- ostream_type const& get_ostream() const { return this->sink.get_ostream(); }
+ ostream_type& get_ostream() { return (*this->sink).get_ostream(); }
+ ostream_type const& get_ostream() const { return (*this->sink).get_ostream(); }
// expose good bit of underlying stream object
- bool good() const { return this->sink.get_ostream().good(); }
+ bool good() const { return (*this->sink).get_ostream().good(); }
};
///////////////////////////////////////////////////////////////////////////
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