I have a pattern that repeats for several member functions that looks like this:
int myClass::abstract_one(int sig1)
{
try {
return _original->abstr
As a variant on Alexander Gessler's solution you can omit some of the braces that make this implementation a little long. It does exactly the same thing, just with a little less { } verbage.
void handle() try
{
throw;
}
catch (std::exception& err)
{
handleException(err);
}
catch (MyException& err)
{
handleMyException(err);
}
catch (...)
{
handleException();
}
int myClass::abstract_one(int sig1) try
{
return _original->abstract_one(sig1);
}
catch (...)
{
handle();
return -1;
}