I get the error "The Polygon class has a virtual 'area' method, but not a virtual destructor" in the Eclipse CDT. What for? Code snippet:
Header Files:
class Shape { public: virtual ~Shape(); protected: virtual double area() const = 0; } class Polygon : public Shape { public: ~Polygon(); protected: double area() const; private: Vertex* vertices; }
Implementation:
Polygon::~Polygon() {delete[] this->vertices;} double Polygon::area() const { ... return areaSum; }
source share