Opened 10 years ago

Closed 9 years ago

#3011 closed Bugs (fixed)

code_converter doesn't support boost::ref( std::istream )

Reported by: Richard Smith <richard@…> Owned by: Jonathan Turkanis
Milestone: Boost 1.40.0 Component: iostreams
Version: Boost 1.38.0 Severity: Problem
Keywords: Cc:


The documentations says that standard iostreams and streambufs model the Device concepts and that they need to be passed by reference via a boost::ref to components expecting a Device. This works in general, but not with the code_converter filter in 1.39. A short test case is:

#include <istream> #include <iostream> #include <boost/ref.hpp> #include <boost/iostreams/code_converter.hpp>

int main() {

namespace io = boost::iostreams; io::code_converter<std::istream> cvt( boost::ref(std::cin) );


A trivial patch that fixes this is attached.

Attachments (1)

iostream_codecvt.diff (503 bytes) - added by richard@… 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by richard@…

Attachment: iostream_codecvt.diff added


comment:1 Changed 9 years ago by anonymous

Is there any chance of this getting fixed? It is a clear case of the code not matching the documentation, and the provided patch is a trivial two-line change.

comment:2 Changed 9 years ago by Daniel James

(In [57609]) Support boost::ref(std::istream) in code_converter. Refs #3011.

By Richard Smith.

comment:3 Changed 9 years ago by Daniel James

Resolution: fixed
Status: newclosed

(In [58633]) Merge iostream fixes, mostly by Richard Smith.

Fixes #3612, #3311, #2094, #3010, #2894, #3011, #3352, #3505.

Note: See TracTickets for help on using tickets.