No matching function for call to swap

Ladies and gentlemen,

I have created the following code block. Its purpose is to convert an object from one programmer-defined type to another. However, for some reason the code gives me the error posted in the title.

1
2
3
4
5
6
7
8
9
struct AnimalConverter {
    template <typename destType> static void convert(Animal *_animal)
    {
        destType *newAnimal = new destType();
        newAnimal->name = _animal->name;
        swap(_animal, newAnimal);
        delete newAnimal;
    }
};


Please help and thanks!
Duplicate @ http://www.cplusplus.com/forum/general/181926/
Please direct responses there.

To OP: Stop posting the same stuff in different threads.
Topic archived. No new replies allowed.