$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Markus Werle (numerical.simulation_at_[hidden])
Date: 2007-01-30 12:05:33
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