#ifndef OSTREAM_ITERATOR_INTH #define OSTREAM_ITERATOR_INTH #include #include using namespace std; class ostream_iterator_int: public iterator { ostream *ost; public: ostream_iterator_int(ostream& initial_ost): ost(&initial_ost) {} const ostream_iterator_int& operator*() const {return *this;} void operator=(int i) const {*ost << i << "\n";} ostream_iterator_int& operator++() {return *this;} }; inline const ostream_iterator_int operator++(ostream_iterator_int& it, int) { const ostream_iterator_int old = it; ++it; return old; } #endif