On 22 July 2012 02:43, Jeremiah Willcock
Can you do lexical_cast<Point>("1 2 3")? If that fails, make sure that reading that string as a Point using istringstream reads the entire contents of the stream (hits EOF and does not set failbit); I am not good enough with streams to know exactly why your code is failing beyond that. If the lexical_cast succeeds, there is a bug in BGL's parsing of the string and I'll take a look at it further.
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Thanks for your reply, Jeremiah! I tried lexical_cast<Point>("1 2 3") and it fails with the same exception too. As for the istringstream part, my code is std::istringstream iStringStream("1"); Point p2; std::istream& returnValue = iStringStream >> p2; std::cout << "Does it reach EOF? " << (returnValue.eof()? "yes" : "no") << std::endl; std::cout << "Is it bad? " << (returnValue.bad()? "yes" : "no") << std::endl; std::cout << "Does it fail? " << (returnValue.fail()? "yes" : "no") << std::endl; std::cout << "Is it good? " << (returnValue.good()? "yes" : "no") << std::endl; This is what it prints. Does it reach EOF? yes Is it bad? no Does it fail? yes Is it good? no So, I suppose the stream reaches EOF, and it is not bad, but it fails, and therefore it is not good. I wonder that these mean? I think I'll search more about that... Thanks again. Best regards, Nicholas