19 ms·
> they use a lot of existing code. Doesn’t everyone? Lots of C++ code is not exception safe, including large libraries such as Qt. If I’m writing code that us
by pansa2 7y ago
> they use a lot of existing code.
Doesn’t everyone? Lots of C++ code is not exception safe, including large libraries such as Qt.
If I’m writing code that uses such a library, would it be better to take Google’s approach and avoid using exceptions myself, or try to “wrap” the non-exception-safe library somehow?
- gumby 7y agoThere is no single answer to that — depends on the library and how you use it. But if it’s not exception safe it’s not exception safe. There is no way to tell if a constructor failed without catching an exception.