Ticket #6812: lc.2.cpp

File lc.2.cpp, 410 bytes (added by Bruce Merry <bmerry@…>, 11 years ago)
Line 
1#include <iostream>
2#include <boost/lexical_cast.hpp>
3
4int main()
5{
6 float f;
7 try
8 {
9 f = boost::lexical_cast<float>(".");
10 std::cout << "boost::lexical_cast<float>(\".\") returned " << f << std::endl;
11 }
12 catch (boost::bad_lexical_cast &e)
13 {
14 std::cout << "boost::lexical_cast<float>(\".\") threw bad_lexical_cast" << std::endl;
15 }
16 return 0;
17}