|
Boost : |
From: Johan Råde (rade_at_[hidden])
Date: 2006-08-17 11:44:58
Robert Ramey wrote:
> Paul A Bristow wrote:
>
>> I managed to get it to compile with MSVC 8.0 (with Boost 1.33.1) but
>> I don't have the serialization library built to it failed to link and
>> run, and I
>> have other more pressing code to do right now.
>
> Note that any such test should test the codecvt facet. This should not
> be related to the serialization library in any way.
>
> Robert Ramey
Robert,
I included some regression tests that test usage with the serialization
library. And, lo and behold, the following test fails on VC++ 7.1:
stringstream ss;
locale old_locale;
locale tmp_locale(old_locale, new extended_num_get<char>);
locale new_locale(tmp_locale, new extended_num_put<char>);
ss.imbue(new_locale);
double x = std::numeric_limits<double>::infinity();
{
text_oarchive oa(ss);
oa & x;
}
double y;
{
test_iarchive ia(ss);
ia & y;
}
BOOST_CHECK(x == y);
The facets extended_num_put and extended_num_get are never called.
Instead std::num_put and std::num_get are called.
There is a workaround: first construct the stream, then construct the
archive, and then imbue the stream with the new locale. But that seems
counter-intuitive.
--Johan Råde
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk