I have a C++ class definition declared in a header file as follows:
template <class T>
class MyClass : public T
{
public:
STDMETHODIMP myMethod();
};
The implementation in a .cpp is this:
template <class T>
STDMETHODIMP MyClass<T>::myMethod() {
// Implementation...
}
The compiler (Visual Studio) is complaining about the method implementation, saying that "anachronism used : modifiers on data ignored" and also "unrecognizable template declaration / definition".
Any ideas what's going wrong?
EDIT:
Might the error be here?
I am trying to extend MyClass, so I declare
class ChildClass : MyClass<SomeConcreteClass>
{
// Stuff...
};