fork download
  1. #include <iostream>
  2. #include <exception>
  3.  
  4. #define singleton_block_begin try {
  5. #define singleton_block_end } catch(...) {}
  6.  
  7. class scoped_singleton
  8. {
  9. public:
  10. ~scoped_singleton() { throw "fuck you"; }
  11. };
  12.  
  13.  
  14. int main()
  15. {
  16. singleton_block_begin
  17. scoped_singleton a;
  18. singleton_block_end
  19.  
  20. singleton_block_begin
  21. scoped_singleton a, b;
  22. singleton_block_end
  23. }
Runtime error #stdin #stdout 0.01s 2852KB
stdin
Standard input is empty
stdout
Standard output is empty