Is there any way to avoid diamond problem form built in a class where I can't inherit virtually like below?
class Widget
{
// Built in class can't be modified
public:
bool draw();
};
class Button : public Widget
{
// Built in class can't be modified
// Not able to put virtual inheritance for Widget Class
};
class MyOwnSpecialWidget : public Widget
{
// Some special treatment for non container widgets
};
class CustomButton : public Button, public MyOwnSpecialWidget
{
// So here the copy of Widget is coming form both Button
// and MyOwnSpecialWidget class.
};
So, what is the way to get only one copy of Widget class in CustomButton class?