fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Test
  5. {
  6. public:
  7. Test()
  8. {
  9. cout << "Test()\n";
  10. }
  11.  
  12. Test(int)
  13. : Test()
  14. {
  15. cout << "Test(int) - 1\n";
  16. throw "Exception";
  17. cout << "Test(int) - 2\n";
  18. }
  19.  
  20. ~Test()
  21. {
  22. cout << "~Test()\n";
  23. }
  24. };
  25.  
  26. int main()
  27. {
  28. try
  29. {
  30. Test t(5);
  31. }
  32. catch (...)
  33. {
  34.  
  35. }
  36. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
Test()
Test(int) - 1
~Test()