3 ms·
By Java mess I meant exception specifications (throws/doesn't throw vs. exception names), sorry for the confusion. The important thing with exceptions in C++ i
by blub 10y ago
By Java mess I meant exception specifications (throws/doesn't throw vs. exception names), sorry for the confusion.
The important thing with exceptions in C++ is having a root class. I use std::exceptions, others are also ok as long as they are used consistently.
If the goal is to trap everything, like in a library even ... is ok.
The big difficulty lies in isolating certain kinds of exceptions to components. Some are recoverable, others should lead to termination, some should interrupt the current operation, others should trigger a retry. The type system offers no support with that.
Verification of noexcept would be a start, as it allows some rudimentary marking of boundaries.