template<unsigned p, unsigned d>
struct A
{
static constexpr int x = 66;
};
template<unsigned p>
struct A
{
static constexpr int x = 66;
};
int main()
{
cout << A<3>::x << endl; //template argument few
}
但是
template<unsigned p, unsigned d>
void printV()
{
cout << 111 << endl;
}
template<unsigned p>
void printV()
{
cout << 90<< endl;
}
int main()
{
printV<3>(); //90
}
无法理解,为什么在函数模板中,代码可以运行,而在类模板中,代码不能运行
谁能告诉我原因