Boost logo

Boost :

From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2003-05-28 00:15:23


>From: "Ian Baxter" <ian_at_[hidden]>

> I wish that the date time library could construct a ptime from it's own
> to_simple_string function.
>
> i.e time = time_from_string( to_simple_string( time ) );
>
> Strange to have library that can construct a time from a string, but not
> from a string it itself has produced.
>
> Also, with MSVC 7.0, the date time library produces the following error
(in
> lexical_cast)
>
> S:\lib\boost_1_30\boost\lexical_cast.hpp(147): error C2678: binary '<<' :
no
> operator found which takes a left-hand operand of type
> 'std::basic_stringstream<_Elem,_Traits,_Alloc>' (or there is no acceptable
> conversion)

Could you have given a code snippet to demonstrate it? I can't find any
lexical_cast-related Date/Time failures in the Win32 regression test tables.

Also, you may want to get the latest lexical_cast version from the CVS, as
some problems were fixed after 1.30 shipped.

However, in the test logs there are several errors for Comeau C++:

lexical_cast_test / como-win32
Run output:
Running 11 test cases...
..\libs\conversion\test\..\lexical_cast_test.cpp(73): error in
"test_conversion_to_char": test '1' == lexical_cast<char>(1.0) failed [1 !=
0]
..\libs\conversion\test\..\lexical_cast_test.cpp(97): error in
"test_conversion_to_int": test 1 == lexical_cast<int>(1.0) failed [1 != 0]
..\libs\conversion\test\..\lexical_cast_test.cpp(99): error in
"test_conversion_to_int": exception boost::bad_lexical_cast is expected
..\libs\conversion\test\..\lexical_cast_test.cpp(101): error in
"test_conversion_to_int": exception boost::bad_lexical_cast is expected
..\libs\conversion\test\..\lexical_cast_test.cpp(124): error in
"test_conversion_to_double": test 1.23 == lexical_cast<double>(1.23) failed
[2061584302 != 3951034368]
..\libs\conversion\test\..\lexical_cast_test.cpp(125): error in
"test_conversion_to_double": test std::numeric_limits<double>::max() / 2 ~=
lexical_cast<double>(std::numeric_limits<double>::max() / 2) failed
[4294967295 !~= 4292870144 (+/-0)]
..\libs\conversion\test\..\lexical_cast_test.cpp(149): error in
"test_conversion_to_bool": test true == lexical_cast<bool>(1.0) failed [1 !=
0]
..\libs\conversion\test\..\lexical_cast_test.cpp(172): error in
"test_conversion_to_string": test "1.23" == lexical_cast<std::string>(1.23)
failed [1.23 != 2061584302]
..\libs\conversion\test\..\lexical_cast_test.cpp(173): error in
"test_conversion_to_string": test "1.111111111" ==
lexical_cast<std::string>(1.111111111) failed [1.111111111 != 1908373954]
..\libs\conversion\test\..\lexical_cast_test.cpp(213): error in
"test_conversion_from_wchar_t": test 1.0 == lexical_cast<double>(L'1')
failed [0 != 1]
Exception in "test_conversion_from_wchar_t": std::bad_cast: bad lexical
cast: source type value could not be interpreted as target
..\libs\conversion\test\..\lexical_cast_test.cpp(236): error in
"test_conversion_to_wchar_t": test L'1' == lexical_cast<wchar_t>(1.0) failed
[49 != 48]
..\libs\conversion\test\..\lexical_cast_test.cpp(277): error in
"test_conversion_to_wstring": test L"1.23" ==
lexical_cast<std::wstring>(1.23) failed
..\libs\conversion\test\..\lexical_cast_test.cpp(278): error in
"test_conversion_to_wstring": test L"1.111111111" ==
lexical_cast<std::wstring>(1.111111111) failed

That's the only compiler reporting errors on the regression test, though.
For example, I don't get any errors on Intel C++ 7.1 in strict mode. Does
anyone have an idea of what could be wrong? What library/C back end is used
for Comeau C++, here?

Regards,

Terje


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk