【发布时间】:2017-04-20 05:29:57
【问题描述】:
template<int max_number> class Test {
private:
// static object definition
static Test Global;
public:
// constructor
Test(int x){
int y;
y = x;
}
//static object definition inside template
Test::Global(5);
};
Test::Global(5) 有错误;如何在模板中声明类对象实例?应该是什么签名?
【问题讨论】:
-
你没有显示错误信息
标签: c++ templates static-classes