【发布时间】:2013-05-10 22:15:07
【问题描述】:
使用 MSVC++ 2010,在其声明块之外定义模板类成员:
template <typename T> class cls {
public:
template <typename T> void bar(T x);
};
template <typename T> void cls<T>::bar(T x) {}
产量:
unable to match function definition to an existing declaration
1> definition
1> 'void cls<T>::bar(T)'
1> existing declarations
1> 'void cls<T>::bar(T)'
为什么?
【问题讨论】: