以下の簡単なコード
// g++ centro.cc -o centro
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
try
{
cout << "Going to throw" << endl;
throw;
}
catch(...)
{
cout << "An exception occurred" << endl;
}
return 0;
}
アボートを生成します:
Going to throw
terminate called without an active exception
Aborted (core dumped)
何が悪いのかわかりません。誰かが私を正しい方向に向けることができますか?