#include <iostream>
#include <string>
#include <boost/lexical_cast.hpp>
using namespace std;
using namespace boost;
int main()
{
string i;
try
{
i=lexical_cast<string>(123.134);
}
catch(bad_lexical_cast&e)
{
cout<<e.what()<<endl;
return 1;
}
cout<<i<<endl;
return 0;
}
Boost练习程序(强制转换)
最新推荐文章于 2024-08-30 16:00:44 发布