Sınıf tanımı:Templated sınıf yöntem tanımı sözdizimi
template<class K, class V,
unsigned hashFunc(const K&),
int compFunc(const K&,const K&)=&_compFunc<K> > class X {};
Sınıf kod bloğunun dışında bir metot tanımlayabiliriz istiyoruz. gibi pek: derleyici şikayet ediyor Neden
template<class K, class V,
unsigned hashFunc(const K&),
int compFunc(const K&,const K&)=&_compFunc<K> >
X<K, V, hashFunc, compFunc>::X() { }
gr ++ v.4.4.3
döndürür ve ben işe nasıl yapabilir? John Dibling işaret ettiği gibierror: default argument for template parameter for class enclosing ‘X::X()’
template<class K, class V,
unsigned hashFunc(const K&),
int compFunc(const K&,const K&)>
X<K, V, hashFunc, compFunc>::X() { /* ... */ }
, sınıf X besbelli de yapıcı ilan etmeli, ama kod netlik için çıkarıldı kabul: