#include <iostream>
#include <exception>
using std::cout;
using std::endl;
void terminate() {
std::cerr << "set_terminate called" << endl;
abort();
}
int main()
{
std::set_terminate(terminate);
throw 0; // unhandled exception: call set_terminate
return 0;
}
/*
run:
set_terminate called
*/