I am trying to port some code from a visual studio solution to GCC. The code looks like this and I am trying to understand why I am getting this issue
template <class BASE, class SHADER>
class Shader : public BASE {
...
...
~Shader()
{
someAssesrt(0);
}
};
typedef Shader< VertexShader, ddVertexShader> VertexShaderBase;
VertexShaderBase::~VertexShaderBase() <-- ERROR HERE
{
}
The error is:
error: specializing member '{anonymous}::Shader< VertexShader, IDirect3DVertexShader9*>::~ <unnamed>::VertexShaderBase< VertexShader, IDirect3DVertexShader9*>' requires 'template<>' syntax
I am having difficulty understanding this error and some other code components.
First of all what is happening here
typedef Shader< VertexShader, ddVertexShader> VertexShaderBase;
VertexShaderBase::~VertexShaderBase() <-- ERROR HERE
{
}
From my understanding a type of VertexShaderBase
is created and then the destructor of that type is implemented. Isnt the destructor of the type already defined in the type Shader
? If i understand that then maybe I might be able to figure out why I am getting this error. From what I understand is that Shader<VertexShader, ddVertexShader>
is a type somewhere in the code ?
error: specializing member '{anonymous}::Shader< VertexShader, IDirect3DVertexShader9*>::~ <unnamed>::VertexShaderBase< VertexShader, IDirect3DVertexShader9*>' requires 'template<>' syntax
I am not sure what is happening here and help regarding understanding this code would be helpful.