Opened 14 years ago
Closed 13 years ago
#2894 closed Bugs (fixed)
Incorrect type for buffer_size and pback_size parameters
Reported by: | Owned by: | Jonathan Turkanis | |
---|---|---|---|
Milestone: | Boost 1.39.0 | Component: | iostreams |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: | mateusz@… |
Description
Documentation for stream::open says:
void open( const T& t, std::streamsize buffer_size, std::streamsize pback_size );
That seems right to me.
However, on some environments (64-bit), passing std::streamsize arguments causes compilation failure, since the actual implementation has these parameters as int everywhere [*], and the template forwarding stream constructor/open don't work correctly.
Explicitly casting arguments to int in client code works, but changing these parameters everywhere in Boost.Iostreams to std::streamsize fixes things for me.
[*] E.g. at line 16 of boost/iostreams/detail/push_params.hpp:
, int buffer_size = -1 , int pback_size = -1 \
Change History (5)
comment:1 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Version: | Boost 1.38.0 → Boost Development Trunk |
It looks like the change to detail/streambuf/indirect_streambuf.hpp has caused a bunch of regression test failures. e.g. from http://www.boost.org/development/tests/trunk/developer/iostreams.html :
From VC10: indirect_streambuf.hpp(171) : error C2782: 'const _Ty &std::max(const _Ty &,const _Ty &)' : template parameter '_Ty' is ambiguous
From GCC 4.4.1: indirect_streambuf.hpp:171: error: no matching function for call to ???max(int, std::streamsize&)??
Changing line 171 of indirect_streambuf.hpp to cast the '2' to a std::streamsize fixes the failures on VC10.
comment:3 by , 13 years ago
Cc: | added |
---|
Just for records, link to file/line in current revision [source:trunk/boost/iostreams/detail/push_params.hpp@57608#L16 push_params.hpp:16] - it may be changed or even removed in future revs.
(In [57608]) Hopefully fix #2894.
By Richard Smith