Derived curiously recurring templates and covariance
问题 Suppose I have a base class which cloning of derived classes: class Base { public: virtual Base * clone() { return new Base(); } // ... }; I have a set of derived classes which are implemented using a curiously recurring template pattern: template <class T> class CRTP : public Base { public: virtual T * clone() { return new T(); } // ... }; And I attempt to derive from that further like this: class Derived : public CRTP<Derived> { public: // ... }; I get compilation errors to the effect of: