Advertisement
frasl

Untitled

Mar 10th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. struct victim {
  2.     int a;
  3.  
  4.     ~victim() { std::cout << "victim dead" << std::endl; }
  5. };
  6.  
  7. void fn() { throw int(7); }
  8.  
  9. int main()
  10. {
  11.     try {
  12.         victim vic;
  13.  
  14.         fn();
  15.     }
  16.     catch (const int &e) { std::cout << e; }
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement