C++ C++–将基础类型转成string类型 2020年3月9日 yl template <typename T> std::string ToString(const T& t) { std::ostringstream os; os << t; return os.str(); }