Makman2 / CE3D

A terminal 3D engine
GNU General Public License v3.0
4 stars 0 forks source link

Make TransformationChain clonable/copyable #184

Open Makman2 opened 9 years ago

Makman2 commented 9 years ago

TransformationChain is for now not copyable since it works with unique pointers that prohibit that. But the base problem is that we store pointers/references to unknown Transformation types (we only know they have the base type CE3D::Transformation::Transformation).

For now the copy constructor should be deactivated. But you should be able to copy your TransformationChain. So there is just one possibility to enable such a behaviour (or two depending how you want actually implement it):

I would favor variant 2, easy to handle and keeps performance where it needs to be.

This would address all components that store base classes.

Makman2 commented 9 years ago

Interestingly the tests work if you don't copy anything (so you invoke the old copy constructor with an empty TransformationChain). Nice testing flaw...