Такой код:
#include <iostream>
#include <stdexcept>
using namespace std;
void g() try
{
throw std::out_of_range( "range exception" );
}
catch( std::exception &e )
{
cout << "g() catch " << e.what() << endl;
}
// bool or int exception can be thrown
void (*pf)() throw(bool, int) = g;
int main() {
(*pf)(); // Должен возникать UNEXPECTED EXCEPTION
cout << "wtf?" << endl;
return 0;
}
prompt> g() catch range exception
prompt> wtf?
Что за фигня?