Nuacht

You are looking for polymorphic functionality and the only way to achieve that type of dynamic polymorphism in C++ is via virtual functions. The problem is that this only works on one class.