
9 Sep
2004
9 Sep
'04
9:20 p.m.
Johnathan, Funny. It works if I templatize line_wrapping_output_filter like so: template<class CHAR_TYPE> class line_wrapping_output_filter : public output_filter { public: typedef CHAR_TYPE char_type; explicit line_wrapping_output_filter(int line_length = 80) : line_length_(line_length), col_no_(0) { } template<typename Sink> void put(Sink& dest, int c) { if (c == char_type('\n')) col_no_ = 0 ; else { if (col_no_ >= line_length_) this->put(dest, char_type('\n')); ++col_no_ ; } boost::io::put(dest, c); } template<typename Sink> void close(Sink& dest) { boost::io::put(dest, char_type('\n')); col_no_ = 0; } private: int line_length_ ; int col_no_; }; Regards, George.