【发布时间】:2013-10-09 20:23:36
【问题描述】:
我有一个 c++ 模板类,它只有在模板化类型是普通旧数据时才能正确运行。任何带有构造函数的东西都不能正常工作。
当有人尝试这样做时,我想以某种方式获得编译时或运行时警告。
//this should generate error
myclass<std::string> a;
//this should be fine
myclass<int> b;
有什么诀窍吗?
【问题讨论】:
标签: c++ templates typetraits