codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <stdexcept> using std::cout; using std::logic_error; struct Tracked { Tracked() { cout << "*"; } ~Tracked() { cout << "~"; } }; struct Test { Test() { Tracked t; throw logic_error("Yes, it *is* unwound. Things go out of scope as usual."); } }; int main() { try { Test t; } catch (...) {} }
Private
[
?
]
Run code
Submit