My questions are related to the following structure :
The abstract levels are just here to provide the member function for the "real" classes (D1 and D2). As it needs to be highly optimized, there is no virtuality (the destructors of the abstract levels are protected). Is the part with B0-C1-C2-D1 perfectly ok in the following cases :
B0, C1 and C2 have members function with different names ?
C1 and C2 have a function with the same name (for example
myFunction
) ?C1 and C2 and D1 have a function with the same name (for example
myFunction
) ?B0 and C2 have a function with the same name but not C1 (for example
myFunction
) ?
In each case what version of the function will be called by D1 ?
EDIT : a quick piece of code to illustrate that :
template<class CRTP> class A0
{
public:
void myfunction1();
protected:
~A0();
double mymember;
};
template<class CRTP> class B0 : public A0<CRTP>
{
public:
void myfunction2();
protected:
~B0();
};
template<class CRTP> class C1 : public B0<CRTP>
{
public:
void myfunction3();
protected:
~C1();
};
template<class CRTP> class C2 : public B0<CRTP>
{
public:
void myfunction4();
protected:
~C2();
};
class D1 : public C1<D1>, public C2<D1>
{
public:
void myfunction5();
};