EDIT: Another way to ask this question, in perspective, is to ask: Should Lippincott functions "catch all"?
Should Lippincott functions be declared noexcept
?, does it matter?
After all, a version of this function in which all exceptions are captured, by definition cannot produce an exception.
However, in all the examples I see online, the noexcept
is never there and I was wondering if I was missing something.
Example case:
foo_Result lippincott() noexcept???
{
try {
throw;
} catch (const MyException1&) {
return FOO_ERROR1;
} catch (const MyException2&) {
return FOO_ERROR2;
} catch (...) {
return FOO_UNKNOWN;
}
}
foo_Result foo_dothing() {
try {
foo::DoThing();
return FOO_OK;
}
catch (...) {
return lippincott();
}
}