#include #include "except.h" struct raii_t { char * msg; }; void ^?{}( type_raii_t * this ) { printf("%s\n", this->msg); } void bar() { raii_t a = { "Bar dtor" }; throw( 3 ); } void foo() { raii_t a = { "Foo dtor" }; try { raii_t b = { "Foo try dtor" }; bar(); printf("Called bar successfully\n"); } catch( 2 ) { printf("Exception caught\n"); } printf( "Foo exited normally\n" ); } int main() { raii_t a = { "Main dtor" }; foo(); printf("End of program reached\n"); }