
30 Jan
2007
30 Jan
'07
10:05 a.m.
Hi! The following code snippet prints "failure!" during execution: #include <boost/lexical_cast.hpp> #include <iostream> int main() { try { bool test = boost::lexical_cast<bool>("true"); } catch (boost::bad_lexical_cast const &) { std::cerr << "failure!\n"; } } IIRC there was some way to achieve a conversion using the correct locale and stringstreams. Is there a way to obtain a successful conversion with lexical_cast, too? Markus