As Scott Myers wrote, you can take advantage of a relaxation in C++\'s type-system to declare clone() to return a pointer to the actual type being declared:
Use the Public non-virtual / Private virtual pattern :
class Base {
public:
std::auto_ptr clone () { return doClone(); }
private:
virtual Base* doClone() { return new (*this); }
};
class Derived : public Base {
public:
std::auto_ptr clone () { return doClone(); }
private:
virtual Derived* doClone() { return new (*this); }
};