【发布时间】:2013-04-21 00:10:50
【问题描述】:
如何更改以下代码以允许创建 Base 对象 使用模板化构造函数?
struct Base {
template <typename T>
Base(int a) {}
};
int main(int argc, char const *argv[])
{
Base *b = new Base<char>(2);
delete b;
return 0;
}
【问题讨论】:
标签: c++ templates constructor