Opened 13 years ago

Closed 13 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:

Description

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@… 13 years ago.
Patch

Download all attachments as: .zip

Change History (4)

by richard@…, 13 years ago

Attachment: iostream_codecvt.diff added

Patch

comment:1 by anonymous, 13 years ago

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 by Daniel James, 13 years ago

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

By Richard Smith.

comment:3 by Daniel James, 13 years ago

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.