L
l.s.rockfan
Hello,
how do i have to call an inherited, templated class constructor from the
initializer list of the inheriting, non-templated class constructor?
example code:
template<typename T>
class A
{
protected:
sometype* something;
T something_else; /*gives the template some sense here*/
public:
A(sometype* param) : something(param) {};
}
class B : public A<int>
{
public:
B(sometype* param) : A(param) {}; // <== Compiler Error
/* further member functions */
}
The compiler always tries to identify A as a member variable not being
found, instead of the base class' constructor.
how do i have to call an inherited, templated class constructor from the
initializer list of the inheriting, non-templated class constructor?
example code:
template<typename T>
class A
{
protected:
sometype* something;
T something_else; /*gives the template some sense here*/
public:
A(sometype* param) : something(param) {};
}
class B : public A<int>
{
public:
B(sometype* param) : A(param) {}; // <== Compiler Error
/* further member functions */
}
The compiler always tries to identify A as a member variable not being
found, instead of the base class' constructor.