相关疑难解决方法(0)

C++中的模板类

以下C++模板类的功能是什么?我是逐行注释的:

template<class T> string toString(const T& t, bool *ok = NULL) {
         ostringstream stream;
         stream << t;
         if(ok != NULL) *ok = stream.fail() == false;
         return stream.str();
}
Run Code Online (Sandbox Code Playgroud)

这是Java的toString()方法吗?

c++ templates tostring

5
推荐指数
1
解决办法
4989
查看次数

标签 统计

c++ ×1

templates ×1

tostring ×1