A
Angus
#include <iostream>
class CBase
{
public:
virtual int Validate()
{
std::cout << "CBase::Validate" << std::endl;
return 0;
}
};
class CDerived1 : public virtual CBase
{
public:
virtual int Validate()
{
std::cout << "CDerived1::Validate" << std::endl;
return 0;
}
};
class CDerived2 : public virtual CBase
{
public:
virtual int Validate()
{
std::cout << "CDerived2::Validate" << std::endl;
return 0;
}
};
class Diamond : public CDerived1, public CDerived2
{
public:
};
int main()
{
Diamond rq;
rq.Validate();
return 0;
}
class CBase
{
public:
virtual int Validate()
{
std::cout << "CBase::Validate" << std::endl;
return 0;
}
};
class CDerived1 : public virtual CBase
{
public:
virtual int Validate()
{
std::cout << "CDerived1::Validate" << std::endl;
return 0;
}
};
class CDerived2 : public virtual CBase
{
public:
virtual int Validate()
{
std::cout << "CDerived2::Validate" << std::endl;
return 0;
}
};
class Diamond : public CDerived1, public CDerived2
{
public:
};
int main()
{
Diamond rq;
rq.Validate();
return 0;
}