Hi,
I have the following code. and it works fine.
class base
{
public:
base() {};
virtual ~base() {};
virtual void foo() = 0;
virtual void boo() = 0;
};
class derive2 : public virtual base
{
public:
derive2() {};
virtual ~derive2() {};
virtual void foo() {};
};
class derive3 : public virtual base
{
public:
derive3() {};
virtual ~derive3() {};
virtual void boo() {};
};
class derive : public derive2, protected derive3
{
public:
derive(){};
virtual ~derive(){};
};
int main()
{
derive d;
return 0;
}
However, if I modify the derive2 and derive3 class as below
class derive2 : public virtual base
{
public:
derive2() {};
virtual ~derive2() {};
virtual void foo() {};
virtual void boo() {};
};
class derive3 : public virtual base
{
public:
derive3() {};
virtual ~derive3() {};
virtual void foo() {};
virtual void boo() {};
};
then compilation errors are found;
no unique final overrider for 'virtual void base::boo()' in 'derive'
no unique final overrider for 'virtual void base::foo()' in 'derive'
can anyone tell me what is wrong?
Thank you.
Michael