函数模板定义了一组函数
template
T *TestFun(T* src) { return (++src); }
使用时实例化模板函数
int m[10];
int *p = TestFun
类模板定义了一组类
template
class TestClass
{
public:
T *TestFunc(T* src);
};
使用时先实例化类模板
char ch[10];
TestClass
char *p = a.TestFunc(ch);
函数 和 类 有什么区别。。。
基本没有区别