[iostreams] Are streams really models of Device?

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<composite<gzip_compressor, SinkOrStream> > out1(gzip_compressor(), mySink); stream<SinkOrStream> out2(mFileName); However, neither out1 nor out2 compile properly if I define SinkOrStream as: typedef stream<file_sink> SinkOrStream; If I understand the documentation correctly, these should both be legal, no? Does this work for others? I also find it a little strange that streams are supposed to be models of Device and they have a close() method, yet they do not support the closable_tag. Is this by design? Thanks for any help on clarifying these issues... Chad Walters
participants (1)
-
Chad Walters