[ create a new paste ] login | about

Link: http://codepad.org/7pzljoNX    [ raw code | output | fork ]

C++, pasted on Aug 19:
#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 (...) {}
}


Output:
1
*~


Create a new paste based on this one


Comments: