terminateとunexpected

#include <iostream>
using namespace std;

void func() throw(int) {
  throw 0L;
}

void uhandler() {
  cout << "uhandler()" << endl;
}

void thandler() {
  cout << "thandler()" << endl;
  exit(1);
}

int main() {
  set_unexpected(uhandler);
  set_terminate(thandler);
  func();
}
VC


thandler()
続行するには何かキーを押してください . . .

g++


$ g++ -g foo.cpp -o foo && ./foo
uhandler()
thandler()