fork(1) download
  1. #include <iostream>
  2.  
  3. struct A {
  4. A() { throw "cake"; }
  5. };
  6.  
  7. struct B : A {
  8. B() : A() {
  9. try {
  10. // initialize B some more
  11. } catch(char const* reason) {
  12. ::std::cout << "Could not initialize B: " << reason << "\n";
  13. throw;
  14. }
  15. }
  16. };
  17.  
  18. int main() {
  19. B b;
  20. }
Runtime error #stdin #stdout #stderr 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
terminate called after throwing an instance of 'char const*'