3 ms·
You are correct but all those books on cpp exceptions are about a bit more than dealing with issues related to optionally disabling them :-).
by adamnemecek 10y ago
You are correct but all those books on cpp exceptions are about a bit more than dealing with issues related to optionally disabling them :-).
- pjmlp 10y agoAgree, but that is because when compared with other languages exceptions in C++ were always bolted on. They don't play well with manual memory management or the C semantics C++ was trying to be as compatible as possible. They don't play well with: - constructors/destructors - manual resource management - low level code like UNIX signals - allowing every possible type to be used as exception So all of that made C++ exceptions poor cousins of how exceptions are used in other languages. I have used exceptions in quite a few languages and rather use them (the alternative being sum types), but do understand that how C++ evolved they are an unwelcome feature.
- quotemstr 10y agoIt's only exceptions that allow constructors to work properly and that allow the language to support value type management. Without exceptions, you need two-phase initialization, and that's a nightmare.
- pjmlp 10y agoI hate two-phase initialization with passion, specially the way it was done in Symbian C++.