I use this code to control if a sdt::string is a "float" value:
string value("3.14");
try
{
lexical_cast<float>(value);
}
catch(bad_lexical_cast& )
{
cout<
I always obtain a bad_lexical_cast exception.
Perhaps, your locale requires comma as fp: "3,14"