make Ostream_iterator assignable, as befits an output iterator

This commit is contained in:
Marc Glisse 2010-12-05 09:32:16 +00:00
parent aebc58d72a
commit 4174a8cce7
1 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ public:
template <class T, class Stream>
class Ostream_iterator {
Stream& stream;
Stream* stream;
public:
typedef T value_type;
typedef T& reference;
@ -52,11 +52,11 @@ public:
typedef std::ptrdiff_t difference_type;
typedef std::output_iterator_tag iterator_category;
Ostream_iterator( Stream& s) : stream(s) {}
Ostream_iterator( Stream& s) : stream(&s) {}
Ostream_iterator<T,Stream>& operator++() { return *this;}
Ostream_iterator<T,Stream> operator++(int) { return *this;}
Ostream_proxy<T,Stream> operator*() const {
return Ostream_proxy<T,Stream>(stream);
return Ostream_proxy<T,Stream>(*stream);
}
};