On second thought, even though I've found the operators they don't do what I expected them to do in my tests. So, I have the following stream, which is a seekable device:

boost::iostreams::stream<MyStreamDevice> IOStream;

void foo()
{
    char data;
    IOStream >> data;
}

I expected here that MyStreamDevice::read() would be called with a request for 1 byte, since the sizeof( data ) is 1 byte. I want my stream to act as binary, so the bitshift operators should attempt to "fill" the right operand with as much as it can. For longs, this would be 4 bytes for example.

Do I have to overload my own generic bitshift operators for this behavior or does Boost.Iostreams supply some overloaded bitshift operators that provide such functionality?

On Thu, Feb 28, 2008 at 3:54 PM, Robert Dailey <rcdailey@gmail.com> wrote:
Sorry, I posted too early, I found the answer in the documentation. I was looking around forever and I couldn't find it :)


On Thu, Feb 28, 2008 at 3:53 PM, Robert Dailey <rcdailey@gmail.com> wrote:
Does the Boost.Iostreams library have overloaded bitshift operators? That way I could do:

boost::iostreams::stream<myclass> theOutputStream;
theOutputStream << MyData;