for example, your constructor might look like this:
myClass::myClass(Mesh &mesh) : baseClass(mesh)
{
pointer = new Thing(mesh);
}
mesh is not held in myClass, nor is there a getter for mesh in baseClass where it is held. Is this simply a case of having to implement a getter in the base class?
for example you cannot do this:
myClass::myClass(const myClass& original) : baseClass(mesh) //there is no mesh
{
pointer = new Thing(mesh); //mesh is no longer in the parameter list
}
How does the compiler make this copy when it creates a default copy constructor for such classes? Or is this a case where a copy constructor is necessary? mesh is not a private member of brain, and there is not getter for it so how do we make a new Thing?
EDIT – Updated the problem by adding Thing
meshhas to be copied inside thebaseClasscopy constructor.