class point { /* ... */ }; class shape { // abstract class point center; public: point where() { return center; } void move(point p) { center=p; draw(); } virtual void rotate(int) = 0; // pure virtual virtual void draw() = 0; // pure virtual };— end example
struct C { virtual void f() = 0 { }; // error };— end example
class ab_circle : public shape { int radius; public: void rotate(int) { } // ab_circle::draw() is a pure virtual };
class circle : public shape { int radius; public: void rotate(int) { } void draw(); // a definition is required somewhere };would make class circle non-abstract and a definition of circle::draw() must be provided.