Programming, Software Development, Software Engineering, Cpp, Technology.
undefined behavior, regardless of whether the pure virtual function has a definition or not. struct Abstract { virtual void f() = 0; // pure virtual virtual void g() {} // non-pure virtual ~Abstract() { g(); // OK: calls Abstract::g() // f(); // undefined behavior Abstract::f(); // OK: non-virtual