Yes, constructors are not inherited. You need to write a new one for C
:
template <typename T>
class C : public P<T> {
public:
C(T* sometype) { /*...*/ }
};
Note, in addition, that your use of the identifier sometype
is inconsistent. In the case of P
you use it as a variable name, in C
it is a typename, but one that hasn't been declared.
Another question is what the constructor of C
is going to do about the sometype
object. I suspect it is going to do exactly what P
's constructor does, and since you need to call the constructor of the base class anyway, your implementation of the C
constructor will most likely look like this:
template <typename T>
class C : public P<T> {
public:
C(T* sometype):P<T>(sometype) { }
};
As a final remark: C++11 actually offers constructor inheritance as a feature. Since you are not interested in using C++11 features (which is a pity though indeed), and since the feature is not yet implemented by many compilers I won't go into the details. The reference to the feature definition is here.