Index: boost/iostreams/code_converter.hpp =================================================================== --- boost/iostreams/code_converter.hpp (revision 68627) +++ boost/iostreams/code_converter.hpp (working copy) @@ -191,7 +191,6 @@ if (which == BOOST_IOS::out && (flags_ & f_output_closed) == 0) { flags_ |= f_output_closed; detail::execute_all( - detail::flush_buffer(buf_.second(), dev(), can_write::value), detail::call_close(dev(), BOOST_IOS::out), detail::call_reset(dev_), detail::call_reset(buf_.first()), @@ -200,6 +199,14 @@ } } + bool flush() + { + detail::execute_all( + detail::flush_buffer(buf_.second(), dev(), can_write::value) + ); + return true; + } + bool is_open() const { return (flags_ & f_open) != 0;} device_type& dev() { return **dev_; } @@ -254,7 +261,7 @@ public: typedef intern_type char_type; struct category - : impl_type::mode, device_tag, closable_tag, localizable_tag + : impl_type::mode, device_tag, closable_tag, localizable_tag, flushable_tag { }; BOOST_STATIC_ASSERT(( is_same< @@ -286,6 +293,7 @@ std::streamsize read(char_type*, std::streamsize); std::streamsize write(const char_type*, std::streamsize); + bool flush() { return impl().flush(); } void imbue(const std::locale& loc) { impl().cvt_.imbue(loc); } // Direct device access.