我正在尝试为类定义之外的显式专用类模板定义构造函数,如下所示:
template <typename T>
struct x;
template <>
struct x<int> {
inline x();
/* This would have compiled:
x() {
}
*/
};
template <> // Error
x<int>::x() {
}
但这似乎是一个错误。Comeau 说:error: "x<int>::x()" is not an entity that can be explicitly specialized
即使完整的课程是专业的。
这里有什么问题?