Opened 15 years ago
Closed 13 years ago
#1299 closed Bugs (fixed)
change in typedef stringstream_type in format_date_parser.hpp causing compilation error
Reported by: | anonymous | Owned by: | az_sw_dude |
---|---|---|---|
Milestone: | To Be Determined | Component: | date_time |
Version: | Boost 1.38.0 | Severity: | Showstopper |
Keywords: | Cc: |
Description
In format_date_parser.hpp, the typedef stringstream_type (in class format_date_parser) was defined as
std::basic_stringstream<charT>
in boost-1.33.0 but now has changed to
std::basic_ostringstream<charT>
in boost-1.34.1. This change now causes compilation error to any call to the function ->
date_type
parse_date(const string_type& value,
const string_type& format_str,
const special_values_parser<date_type,charT>& sv_parser) const
{
stringstream_type ss;
ss << value;
stream_itr_type sitr(ss); THIS ERROR IS IN THIS LINE !!
stream_itr_type stream_end;
return parse_date(sitr, stream_end, format_str, sv_parser);
}
The compiler error (for boost-1.34.1) is ->
format_date_parser.hpp:221: error: invalid conversion from `void*' to `std::basic_streambuf<char, std::char_traits<char> >*'
and is observed with multiple versions of gcc (3.4.x and 4.x).
Here's a simple example ->
#include <sstream> int main() { typedef std::basic_ostringstream<char> stringstream_type; typedef std::istreambuf_iterator<char> stream_itr_type; stringstream_type ss; stream_itr_type itr(ss); return 0; }
The above program does not compile unless stringstream_type is changed to std::basic_stringstream<char>.
Change History (5)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Version: | Boost 1.34.1 → Boost 1.37.0 |
Hi,
This bug seems to be still part of the 1.37.0 version of boost.
1.37.0_gcc4.3.2include/boost-1_37/boost/date_time/format_date_parser.hpp: In member function 'date_type boost::date_time::format_date_parser<date_type, charT>::parse_date(const std::basic_string<OutputT, std::char_traits<_CharT>, std::allocator<_T2> >&, const std::basic_string<OutputT, std::char_traits<_CharT>, std::allocator<_T2> >&, const boost::date_time::special_values_parser<date_type, charT>&) const [with date_type = boost::gregorian::date, charT = char]': Utilities.cpp:474: instantiated from here /1.37.0_gcc4.3.2include/boost-1_37/boost/date_time/format_date_parser.hpp:221: error: invalid conversion from 'void*' to 'std::basic_streambuf<char, std::char_traits<char> >*' /sbcimp/run/pd/boost/64-bit/1.37.0_gcc4.3.2include/boost-1_37/boost/date_time/format_date_parser.hpp:221: error: initializing argument 1 of 'std::istreambuf_iterator<_CharT, _Traits>::istreambuf_iterator(std::basic_streambuf<_CharT, _Traits>*) [with _CharT = char, _Traits = std::char_traits<char>]'
Ramesh
comment:4 by , 14 years ago
1.37 did not include the fix. It is fixed in trunk and should go into 1.38. Please, check the recent checkout from branches/release.
comment:5 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Version: | Boost 1.37.0 → Boost 1.38.0 |
I encountered the same error messsage when compiling with VC90 (MS Visual Studio 2008) and boost_1_35_0. After changing stringstream_type back to typedef std::basic_stringstream<char> (as in boost_1_33_1), it compiles again.