fork(1) download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. struct Abstract {
  5. virtual void pure() = 0;
  6. virtual void foo() {
  7. pure();
  8. }
  9. Abstract() {
  10. foo();
  11. }
  12. ~Abstract() {
  13. foo();
  14. }
  15. };
  16.  
  17. struct X : public Abstract {
  18. virtual void pure() { cout << " X :: pure() " << endl; }
  19. virtual void impure() { cout << " X :: impure() " << endl; }
  20. };
  21. int main() {
  22. X x;
  23. }
Runtime error #stdin #stdout 0.02s 2720KB
stdin
Standard input is empty
stdout
Standard output is empty