Child1 and Child2 have many common functions (e.g. common1, ... commonN), but each class has its own unique functions too. These functions usually manipulate the vector x.
I attempted to put Child1 and Child2 under a parent class, so that I can put all common functions in the parent class. However, I confronted some obstacles such as:
1) If I create a parent class and have it contain all common functions, the common functions should have access to vector members of the derived classes. I don't think it is doable..
Overall, can you please give me any advice on what would be the best strategy to solve code duplication and inheritance problem??