I would like to do something like the following:
Code:
template<class T>
class BaseClass
{
public:
BaseClass(void);
//....
}
template<class T> BaseClass<T>::BaseClass(void)
{
//....
}
class SubClass : public BaseClass<SomeType>
{
pubic:
SubClass(void);
//....
}
SubClass::SubClass(void)
{
//...
}
Using MSVC++ 7, everything compiles fine, but I am getting unresolved external symbol errors from the linker for each function in SubClass stating that a definition in BaseClass is missing. For example, the constructor gives the error
Code:
unresolved external symbol: BaseClass<SomeType>::BaseClass<SomeType>(void)
The generic function definitions are there. This seems to imply that I need to supply specific definitions to be able to inherit this way. Am I doing something wrong? Surely a class structure like this is possible, isn't it?