#include <boost/lexical_cast.hpp>
bool IsInteger(const std:string strInteger)
{
try
{
int a = boost::lexical_cast<int>(strInteger);
}
catch (exception e)
{
//转换失败会执行到这里
return false;
}
return true;
}
bool IsDouble(const std::string strDouble)
{
try
{
double a = boost::lexical_cast<double>(strDouble);
}
catch (exception e)
{
//转换失败会执行到这里
return false;
}
return true;
}