>From: "Early Ehlinger" <[EMAIL PROTECTED]>
> This is an interesting argument. In other words, lexical_cast is, by
> definition, conversion through a stream. Therefore, one cannot expect a
> string with whitespace to exit as it went in.
Not a string that uses whitespace as termination, no. However, that also
means that you can't lexical_cast convert any type that has whitespace in
its stream output, to std::string, which could make it rather less useful.
This is the current situation.
Note that it doesn't end there:
std::string str=boost::lexical_cast<std::string>(""); // Throws
Shouldn't this be allowed, either? This is also a case that has resulted in
problem-reports for the current version. This is fixed in the proposal, and
the fix for both whitespace and empty strings can work the same way:
std::stringstream interpreter;
interpreter << source;
return interpreter.str();
Regards,
Terje
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost