18.4 Multiple Inheritance
It's okay if you want to experiment with multiple inheritance. But do yourself and others who read your code a favor: do not introduce multiple inheritance into long-term projects—with one exception, which is that you can use signature classes to emulate interfaces as they exist in Java.
Don't get me wrong. Multiple inheritance as a concept is fine, and it has its place in teaching object orientation. It is even necessary to model certain things well. After all, not everything in the real world can be forced into a tree-like hierarchy. In C++, however, a project becomes unmanageable if multiple inheritance is used thoughtlessly. Even if it looks good in the textbook, it is not practical to take the real world as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access