C++:类型转换 1. 转为string 1. 转为string template<typename T> string toString(const T& t){ ostringstream oss; oss << t; return oss.str(); }