I’m not getting the partial template specialization.
My class looks like this:
template<typename tVector, int A>
class DaubechiesWavelet : public AbstractWavelet<tVector> { // line 14
public:
static inline const tVector waveletCoeff() {
tVector result( 2*A );
tVector sc = scalingCoeff();
for(int i = 0; i < 2*A; ++i) {
result(i) = pow(-1, i) * sc(2*A - 1 - i);
}
return result;
}
static inline const tVector& scalingCoeff();
};
template<typename tVector>
inline const tVector& DaubechiesWavelet<tVector, 1>::scalingCoeff() { // line 30
return tVector({ 1, 1 });
}
The error gcc outputs is:
line 30: error: invalid use of incomplete type ‘class numerics::wavelets::DaubechiesWavelet<tVector, 1>’
line 14: error: declaration of ‘class numerics::wavelets::DaubechiesWavelet<tVector, 1>’
I’ve tried several solutions, but none worked.
Anybody has a hint for me?
That’s a definition of a member of a partial specialization that would be defined as follows
It’s not a specialization of the member “scalingCoeff” of the primary template “DaubechiesWavelet”. Such a specialization is required to pass the value of all arguments, which your specialization does not do. To do what you want, you can use overloading though
Notice that the initialization syntax you use will only work in C++0x.