My situation looks something like this:
class Parent;
class Child1 : public Parent;
class Child2 : public Parent;
class ChildOfChild1 : public Child1;
std::vector<std::vector<Parent>> matrix;
I want to be able to contain all the classes within this one matrix but I am not sure of the best way to do it.
Right now if left as it is every Child I add to the matrix just gets converted into a Parent with all the methods and variables not contained in the Parent removed.
I know something like this should be possible in Java which is also strictly typed so I thought I might ask if it is also possible in C++.