i have a class with the following structure:
class myClass { private: int type; classOne objectOne; classTwo objectTwo; public:
ClassOne and ClassTwo need to have the same return type then either via inheritance or composition. i.e ClassOne and ClassTwo need to be subclasses of the same super class OR they need to impl the same interface.