【发布时间】:2010-11-19 17:25:52
【问题描述】:
类定义:
template<class K, class V,
unsigned hashFunc(const K&),
int compFunc(const K&,const K&)=&_compFunc<K> > class X {};
我想在类代码块之外定义一个类方法。像这样:
template<class K, class V,
unsigned hashFunc(const K&),
int compFunc(const K&,const K&)=&_compFunc<K> >
X<K, V, hashFunc, compFunc>::X() { }
g++ v.4.4.3 返回
错误:模板的默认参数 包含“X::X()”的类的参数
为什么编译器会抱怨,我怎样才能让它工作?
【问题讨论】: