Boost logo

Boost Users :

Subject: [Boost-users] lexical_cast and float
From: Claude (clros_at_[hidden])
Date: 2011-06-19 13:44:42


Hi!

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<<value<<" is not a float number\n";
}

I always obtain a bad_lexical_cast exception.

Why?

--
View this message in context: http://boost.2283326.n4.nabble.com/lexical-cast-and-float-tp3609634p3609634.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net