fork(20) download
  1. #include <iostream>
  2.  
  3. struct abc {
  4. virtual ~abc() {}
  5. };
  6.  
  7. struct d : abc {
  8. void operator delete(void*) { std::cout << "goodbye\n"; }
  9. };
  10.  
  11. int main() {
  12. abc *p = new d;
  13. delete p;
  14. }
  15.  
Success #stdin #stdout 0.01s 2812KB
stdin
Standard input is empty
stdout
goodbye