iam developing a class that derives from another , but i am getting stuck , with this code:
template <class A, class B, class C>
class BaseClass
{
public:
BaseClass(){}
virtual void amethod( A* aPtr=0)
{
mAPtr=aPtr;
}
virtual void init()=0;
protected:
A * mAPtr;
B* mBPtr;
C * mCPtr;
};
template <class A,class B,class C>
class ChildClass: public BaseClass<A,B,C>
{
public:
ChildClass( A* aAptr =0, B * aBPtr= 0, C* aCPtr= 0):mAPtr(aAptr)
,mBPtr(aBPtr)
,mCPtr(aCPtr)
{}
};
int main()
{
return 0;
}
The compiler out says that the child class doesnt have any of the parent field.
Compiler out:
In constructor 'ChildClass<A, B, C>::ChildClass(A*, B*, C*)'
In constructor 'ChildClass<A, B, C>::ChildClass(A*, B*, C*)'
error: class 'ChildClass<A, B, C>' does not have any field named 'mAPtr'
error: class 'ChildClass<A, B, C>' does not have any field named 'mBPtr'
error: class 'ChildClass<A, B, C>' does not have any field named 'mCPtr'
i have searching in google but i cannot find an answer: Thx in advance