Standard stream and stream buffers are supposed to be models of the Device
concept (http://www.boost.org/libs/iostreams/doc/concepts/device.html).
However, I am finding that their treatment by various parts of the library
doesn't seem to be consistent. For example, streams don't actually seem to
be usable everywhere a Device can be used.
For example, if I define SinkOrStream as follows:
using namespace boost::iostreams;
typedef file_sink SinkOrStream;
Then the following declarations compile properly:
SinkOrStream mySink(mFileName);
stream