64,654
社区成员
发帖
与我相关
我的任务
分享
#ifndef _TEST_OBJ_H
#define _TEST_OBJ_H
#include <stdio.h>
class OBJ{
public:
template<typename T>
void test(T value){
printf("标准特化\n");
}
};
template<>
void OBJ::test(int value){
printf("int特化\n");
}
#endif
#include "obj.h"
int main()
{
OBJ obj;
obj.test(1.1);
obj.test(1);
return 0;
}