64,654
社区成员
发帖
与我相关
我的任务
分享
#include "stdafx.h"
#include <iostream>
struct webcam{
};
struct 数码摄像头: webcam{
};
struct 光子摄像头: webcam{
};
template <typename T>
class execute{
public:
};
template<>
class execute<数码摄像头>
{
public :
static void fun(){ std::cout<<"数码"<<std::endl; }
};
template<>
class execute<光子摄像头>
{
public:
static void fun(){ std::cout<<"光子"<<std::endl; }
};
int _tmain(int argc, _TCHAR* argv[])
{
execute<光子摄像头>::fun();
return 0;
}