> string value("3.14");
> try { lexical_cast<float>(value); } catch(bad_lexical_cast& ) { cout<<value<<" is not a float number\n"; }
> I always obtain a bad_lexical_cast exception.
Perhaps, your locale requires comma as fp: "3,14"
But what if one did want to convert from "3.14" instead of "3,14"? How can one specify the customization in this case?