
8 May
2007
8 May
'07
10:47 a.m.
Hello, I get an exception if I write an empty ptree to a stringstream and try to reconstruct a ptree from this stringstream. <unspecified file>(2): xml parse error test code: int main( int argc, char *argv[]) { try { std::stringstream ss; { pt::ptree p; pt::write_xml( ss, p); } std::cout << ss.str() << std::endl; { pt::ptree p; pt::read_xml( ss, p); // throws exception } return EXIT_SUCCESS; } catch ( std::exception const& e) { std::cerr << e.what() << std::endl; } catch ( ... ) { std::cerr << "unhandled exception" << std::endl; } return EXIT_FAILURE; }