c++ 模板实现字符串数字之间的转换
template <class Type>
Type StringToNum(const string& str)
{
istringstream iss(str);
Type num;
iss >> num;
return num;
}
template <class Type>
string NumToString(Type i)
{
stringstream ss;
ss << i;
return ss.str();
}