Hi all,
I experience a strange behavior of parsing non-JSON data with JSON parser. I can create a property_tree from a simple non-JSON string, without exception. And serializing back the result throws :
boost::property_tree::ptree m_tree;
// Non-JSON to ptree using JSON parser
std::istringstream is("1"); // Simple value, non-JSON
boost::property_tree::json_parser::read_json(is, m_tree); // ==> No exception, I now have a valid ptree object.
// ptree back to JSON
std::ostringstream buf;
boost::property_tree::json_parser::write_json(buf, m_tree, false); // ==> Exception