diff --git a/Stream_support/include/CGAL/IO/Ostream_iterator.h b/Stream_support/include/CGAL/IO/Ostream_iterator.h index 858a4d210ea..1f263f180dd 100644 --- a/Stream_support/include/CGAL/IO/Ostream_iterator.h +++ b/Stream_support/include/CGAL/IO/Ostream_iterator.h @@ -42,7 +42,7 @@ public: template 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& operator++() { return *this;} Ostream_iterator operator++(int) { return *this;} Ostream_proxy operator*() const { - return Ostream_proxy(stream); + return Ostream_proxy(*stream); } };