Here's a templated parent class:
I want to inherit this class with a specific type, like this:Code:template<class T> class A { public: A(T param); ~A(); } template<class T> A::A(T param) { // do stuff with type T parameter } template<class T> A::~A() { // undo stuff }
Is this possible? Is this the right syntax to do it?Code:class B : public A<int> // or any other type { public: B(int param); ~B(); } B::B(int param) : A(param) { } B::~B() { }




Reply With Quote