新兵上阵
- 注册时间
- 2012-9-2
- 金币
- 27 个
- 威望
- 0 个
- 荣誉
- 0 个
累计签到:2 天 连续签到:0 天 [LV.20]漫游旅程
|
#include <string>
#include <sstream>
namespace patch
{
template < typename T > std::string to_string( const T& n )
{
std: stringstream stm ;
stm << n ;
return stm.str() ;
}
}
#include <iostream>
int main()
{
std::cout << patch::to_string(1234) << '\n' << patch::to_string(1234.56) << '\n' ;
}
http://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-g |
|