
Hi Steven
-----Original Message----- From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Steven Watanabe via Boost-users ... std::streamsize optimal_buffer_size() const { return 0; }
template<typename Sink> std::streamsize write(Sink& snk, const char* s, std::streamsize n) { std::streamsize result = iostreams::write(snk, s, n); chars_ += result; return result; }
Thanks for the tip! I had hoped there was some kind of well hidden buffer pointer to do some pointer arithmetic. One problem I stumbled into with the counter filter: If optimal_buffer_size() returns 0, write() is called with 1 byte buffers. In my case this increased the program runtime from 8 seconds to 4 minutes. Returning a larger value solved this issue for my use case. Regards, Peter.