Is it in good style do use cerr in situation described below?
try
{
cout << a + b;
}
catch(const IntException& e)
{
cerr << "Exception caught: " << typeid(e).name(); //using cerr not cout
}
catch(...)
{
cerr << "Unknown exception.";//using cerr not cout
}
or cout should be used? See comments in code.
catch (...)
without either rethrowing the exception or terminating the program. You have no idea what the exception is and there is absolutely no way to know whether it is safe to continue execution. – Quickman