[IOStreams] Inconsistency b/w docs and code of stream()

Hey guys, I'm working with the boost::iostreams library to create a stream object from a Device class I've implemented. I'm trying to call the constructor that allows setting of the buffer size and it is failing to compile on 64 bit. I used the documenation at http://www.boost.org/libs/iostreams/doc/guide/generic_streams.html#stream The docs say the constructor is of the form: stream(const T& t, std::streamsize buffer_size = default_value, std::streamsize pback_size = default_value); My code to create the stream looks like: MyDevice myDevice(...) MyStream(myDevice, (std::streamsize)500); On a 32 bit machine this works fine, but on a 64 bit one it does not compile. The parameters I'm passing in are not matching up with a constructor in the stream class so it tries to call MyDevice with the wrong set of parameters. I believe the culprit is the file iostreams/detail/push_params.hpp, which defines the buffer and pback size using: #define BOOST_IOSTREAMS_PUSH_PARAMS() \ , int buffer_size = -1 , int pback_size = -1 \ /**/ This macro is then used by stream and friends in their constructor declarations. On 64 bit machines std::streamsize is a long int, so the constructor parameters do not match up and compilation fails. Thanks, -n

Nitay Joffe wrote:
Hey guys,
I'm working with the boost::iostreams library to create a stream object from a Device class I've implemented. I'm trying to call the constructor that allows setting of the buffer size and it is failing to compile on 64 bit.
I used the documenation at http://www.boost.org/libs/iostreams/doc/guide/generic_streams.html#stream
The docs say the constructor is of the form:
stream(const T& t, std::streamsize buffer_size = default_value, std::streamsize pback_size = default_value);
My code to create the stream looks like:
MyDevice myDevice(...) MyStream(myDevice, (std::streamsize)500);
On a 32 bit machine this works fine, but on a 64 bit one it does not compile. The parameters I'm passing in are not matching up with a
Would you please post the compiler errors?
Thanks, -n
-- Jonathan Turkanis CodeRage http://www.coderage.com
participants (2)
-
Jonathan Turkanis
-
Nitay Joffe