Boost logo

Boost Users :

Subject: Re: [Boost-users] Flushing a filtering_ostreambuf
From: eg (egoots_at_[hidden])
Date: 2009-01-30 13:05:43


jean-louis.a.leroy_at_[hidden] wrote:
>
> However, when I put it in a filter, flushing the filter doesn't flush
> the stream:
>
>
> // scope
> {
> stream_buffer<debug_output_sink> debug_streambuf(debug_sink);
> ostream debug_stream(&debug_streambuf);
>
> filtering_ostreambuf filtering_buf;
> filtering_buf.push(debug_stream);
>
> ostream os(&filtering_buf);
> os << "test";
> os.flush(); // nothing
> filtering_buf.pubsync(); // nothing either
> filtering_buf.strict_sync(); // still nothing
> }
> // characters appear at last !
>
> What I am missing here?

You may wish to read the thread at:
http://thread.gmane.org/gmane.comp.lib.boost.user/33355

In particular, read the posts by Jonathan Turkanis. It may (or may not?)
shed some additional light on flush.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net