fork(1) download
  1. #include <iostream>
  2.  
  3. class X
  4. {
  5. public:
  6. X() { throw 1; }
  7. };
  8. class Y
  9. {
  10. public:
  11. Y() try: x() { }
  12. catch(...) { /* throw; */ }
  13. private:
  14. X x;
  15. };
  16.  
  17. int main() try
  18. {
  19. Y y;
  20. return 0;
  21. }
  22. catch (int i)
  23. {
  24. std::cerr << "exception: " << i << std::endl;
  25. }
  26.  
Success #stdin #stdout #stderr 0s 3224KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
exception: 1