fork download
  1. #include <iostream>
  2.  
  3. int f(int) { throw 1; return 0; }
  4. class C {
  5. int i;
  6. double d;
  7. public:
  8. C(int, double);
  9. };
  10.  
  11. C::C(int ii, double id)
  12. try : i(f(ii)), d(id) {
  13. // constructor statements
  14. }
  15. catch (...) {
  16. std::cout << "Caught";
  17. }
  18.  
  19. int main() {
  20. C c(1,2.0);
  21. }
Runtime error #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
Caught