I was interested to learn about the following case, but I do not see enough terminology to find any answers anywhere.
Let's start with the general case: I have only 3 classes. 2 of them are inherited from the third and should be considered as specializations.
Now these 3 classes seem partially abstract and each of them introduces new pure virtual functions, because this βclass structureβ can be implemented differently for different purposes. And each of these 3 classes gets access to pure virtual functions from the inside, so they cannot be implemented later.
Then there is a 4th class that inherits from the second in order to specialize the purpose of pure virtual functions of the second class. There is also a 5th grade that does the same for 3rd grade.
Now there are still pure virtual functions of the 1st class that need specialization in accordance with the 4th and 5th classes. This is where I am having some problems, and I might think of two ways to solve this problem that really do not satisfy me.
- Have a 6th grade inherited from 1st grade and specialize in meeting the needs of 4th and 5th grade, and these classes inherit from 6th grade. This will lead to a "scary diamond."

- Have a 6th grade that does not inherit from 1st grade, but which nonetheless implements a specialized assignment suitable for 4th and 5th grades. Then the 4th grade and the 5th grade inherit from the 6th and add the implementation of pure virtual functions of the 1st grade. These implementations do nothing but call the similar functions of the 6th, passing the same parameters, etc.

I am currently seeking a second solution, as I want to avoid the "diamond fear." But I don't like the extra implementation code that comes with it. Isn't there an easier way to combine different (interfaces /) classes?
For example, using the second solution, I thought of something like the same function prototypes in the 6th class as in the first class, and told the compiler that the 1st function should be redefined by the 6th class function. Unfortunately, using myfunction; inside a class declaration of 4th and 5th grade does not work.
Or asked in general: is there a way to join the "interfaces" - this means that a pure virtual function of a class can be defined by a completely different class if the prototype is the same and as long as they are both inherited from the child. I want to avoid duplicating code as much as possible, since I don't need βheavyβ classes.
If this illustration is too abstract, I will give an example.
β¬ dit: Ask your opinion: what would be the best solution in this case?