In my C++ program, I have two classes (B1 and B2) with their own methods but 1 ("accidentally") in common. For example:
class B1 header:
void height();
void size();
void enabled();
class B2 header:
void width();
void length();
void enabled();
Now I have a class A that inherit from B1 and B2. Since I have a "conflict" in method enabled()
after multiple inheritance, how can I avoid this? Is there a way to exclude a method from inheritance? For example I could exclude enabled()
inheritance from class B1 (I cannot set it private since it's used from other classes derived from B1). Any other idea?