I have been told if you have a reference in a class you have to create new versions of that class rather than copy them around. Why? Because you are actually referring to the original thing when you assign a reference and so you’re not actually doing anything. The thing is, why does it still work?
My GameObjects contain references to Meshes, and I can copy them around fine and they all render in the right places and everything.
The copy constructor is initialising a new reference, which is fine.
What you can’t do is reassign the reference later.
Here’s an example, assuming your class can be constructed by supplying a
Mesh, to which it retains a reference:(That’s assuming you don’t define a copy-assignment operator. If you do, then it will have to leave the reference alone.)