Added virtual dtor to make the example standalone
This commit is contained in:
hsutter
2018-06-18 11:25:16 -07:00
parent 0d0026e61e
commit aa645b0372

View File

@@ -2116,11 +2116,13 @@ This will force every derived class to compute a center -- even if that's non-tr
class Shape { // better: Shape is a pure interface class Shape { // better: Shape is a pure interface
public: public:
virtual Point center() const = 0; // pure virtual function virtual Point center() const = 0; // pure virtual functions
virtual void draw() const = 0; virtual void draw() const = 0;
virtual void rotate(int) = 0; virtual void rotate(int) = 0;
// ... // ...
// ... no data members ... // ... no data members ...
// ...
virtual ~Shape() = 0;
}; };
##### Enforcement ##### Enforcement