Hello,
using the Boost.Serialization library version 1.43, I saved to an XML
archive a float number which has a value of infinite; then loading
that XML file leads to a boost::archive::archive_exception,
exception.what() return "stream error". The source code to reproduce
the problem is the following:
#include
#include <sstream>
#include
#include
#include <iostream>
struct XXX
{
friend class boost::serialization::access;
template<class Archive> void serialize(Archive & ar, const
unsigned int version)
{
ar & BOOST_SERIALIZATION_NVP(mValue);
}
float mValue;
};//struct
int main()
{
std::wstringstream lSS;
boost::archive::xml_woarchive oa(lSS);
XXX xxx;
float zero = 0.f;
xxx.mValue = 1 / zero;
oa << BOOST_SERIALIZATION_NVP(xxx);
std::wcout<<"saved:"<> BOOST_SERIALIZATION_NVP(xxx);
std::wcout<<"loaded:"<
result = boost::spirit::parse(arg.begin(), arg.end(), rule_);
return result.hit;
where the parse function fails since result.hit is equal to false.
I resolved the issue by checking all the data preventing accurately
any infinite value before it is saved to an xml archive, but I wonder
if this problem belongs to the library itself or not.
Greetings,
Luca