To solve the problem of inheritance in the form of a diamond. (B and C both inherit from A. What happens to attributes A in D, which themselves inherit from B and C?)
Your library client may see RedWidget and FlyingWidget and may want to combine them into RedFlyingWidget.
The user must specify that one of the base classes be virtual when inheriting. But this is not the responsibility of the creator of the library.
OOP streams are better with single-implementation inheritance, so I would use the whole library.
There are also trees with inverted inheritance, as described by Alexandrescu perfectly " Modern C ++ Design ." They allow customers to use more functionality in the form of mixing, which are called policies.
Policy-based programming enhances the ability to combine functionality through syntactic cleanliness. For example, consider implementing an STL.
source share