fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct A
  5. {
  6. void * operator new [] (size_t t, int, int)
  7. {
  8. cout << "3 parameters allocation" << endl;
  9. return ::operator new[](t);
  10. }
  11.  
  12. void operator delete [] (void *p, int, int)
  13. {
  14. cout << "3 parameters deallocation" << endl;
  15. return ::operator delete[](p);
  16. }
  17. };
  18.  
  19. int main()
  20. {
  21. A *a = new (5,5) A[10];
  22. delete [] a;
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:22:12: error: no suitable ‘operator delete []’ for ‘A’
  delete [] a;
            ^
stdout
Standard output is empty