Comment by groundzeros2015
6 hours ago
Guaranteed destructors is probably the most complex features ever added to C++, more than templates or move semantics.
6 hours ago
Guaranteed destructors is probably the most complex features ever added to C++, more than templates or move semantics.
The combination of exceptions and non-trivial {copy constructor, assignment operator, destructor} are what combine to make C++ a somewhat broken language when you try to use all the features. And also responsible for poisoning the well for exceptions as an error handling mechanism for native code.
Delphi did native exceptions much better IMO.
How do native exceptions work in Delphi?
Very similar to Windows Structured Exception Handling, which the Win32 implementation used, and also looks similar to Java, but without checked exceptions. try/except/end and try/finally/end blocks.
The major differences with C++:
It's not a memory safe language, but it does give you a bunch of idioms that, if you stick to them, you don't feel nearly as much pain as C++.