What I am looking to do is develop two different base classes which should not be inherited together in the one derived class. Is there any way I can enforce this at compile time?
class Base1 {};
class Base2 {};
class Derived1 : public Base1 {} // OK!
class Derived2 : public Base2, public Other {} // OK!
class Derived3 : public Base1, Base2 {} // Can I force the compiler to complain?
Derived1 d1; // OK!
Derived2 d2; // OK!
Derived3 d3; // Or can I force the compiler to complain here?
I'm aware that documentation is a good idea, just wondering if it is possible.