123456789
struct AnimalConverter { template <typename destType> static void convert(Animal *_animal) { destType *newAnimal = new destType(); newAnimal->name = _animal->name; swap(_animal, newAnimal); delete newAnimal; } };