Ticket #4590 (closed Bugs: fixed)
Flushing a filtering_ostream stopped working in Boost 1.44
|Reported by:||t0rt1e@…||Owned by:||turkanis|
|Milestone:||To Be Determined||Component:||iostreams|
Since the update to Boost 1.44, flushing an filtering_ostream containing an output_filter and a sink different from std::cout (tested boost::iostreams::back_inserter(std::string) and boost::test_tools::output_test_stream) using the flush() member function stopped working. The output string stays empty. This used to work until Boost 1.43.
I tried to replace the call of flush() with the sync() member function documented in <http://www.boost.org/doc/libs/1_44_0/libs/iostreams/doc/classes/filtering_stream.html>, which leads to compiler error that filtering_ostream does not have this member function. Only using the member function strict_sync() flushes correctly the filtering_ostream in Boost 1.44.
Attached is a test case based on the back_inserter example in <http://www.boost.org/doc/libs/1_44_0/libs/iostreams/doc/tutorial/container_sink.html> augmented by a transparent filter simplified from the code example in <http://www.boost.org/doc/libs/1_44_0/libs/iostreams/doc/concepts/output_filter.html>.
Changed 6 years ago by duncanphilipnorman@…
- attachment boost_iostreams_filtering_ostream_does_not_flush_at_all.cpp added
- Cc duncanphilipnorman@… added