Curiously recurring template pattern: Difference between revisions

Content deleted Content added
History: removed misplaced comma
Updated code to C++11 standard
Line 212:
class Shape {
public:
virtual ~Shape() {}= default;
virtual Shape *clone() const = 0;
};
Line 219:
class Shape_CRTP : public Shape {
public:
virtual Shape *clone() const override{
return new Derived(static_cast<Derived const&>(*this));
}