【发布时间】:2018-04-27 09:29:18
【问题描述】:
我收到与previous discussion 相同的警告消息,但我不明白如何解决:
警告:foo::value 的模板头太多(应该为 0) int const foo::value = 1;
当你想使用以下玩具头时会出现警告消息:
#ifndef FOO
#define FOO
template<int T>
struct foo;
template<>
struct foo<1>
{ static int const value; };
template<>
int const foo<1>::value = 1;
#endif
你能解释一下这是什么问题吗?
【问题讨论】: