Suppose I have a base class,
struct X{
std::container<class> A;
std::container<class> B;
void do_this(...){...};
void do_that(...){...};
X(classC something){
do_this(...);
do_that(...);
}
}
And I want to create a descendant, but I need to only change a couple of lines in one of the methods called in the constructor:
struct Y:X{
void do_this(...){
// make my changes
}
}
Now, when I call Y(classC input)
, I should get my Y
struct as intended, right?
How would I do this in C++?