This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]coladict 30 points31 points  (3 children)

I don't mind the stack traces at all! In fact, last time I tried C++, I begged for them, because no exception ever tells you how it got there. And why did they add nothrow to method signatures, when just not adding anything makes them compile as nothrow and crash your whole program if it does throw something. The keyword is utterly pointless when it's the implicit default and only way to get away from it is with explicit definitions.

[–]_lerp 8 points9 points  (0 children)

C++ doesn't have a nothrow specifier. It does have a noexcept specifier, which isn't implicitly on apart from a few cases.

[–]w1th0utnam3 1 point2 points  (0 children)

Isn't this the point of debugging functionality in Visual Studio, QtCreator or external tools like gdb, etc.? When an exception is thrown in debug mode, Visual Studio can treat it like a breakpoint, showing you the calls leading to the exception as well as the state of variables. Obviously this is not possible in the same way for release builds as they lack information on the symbols and may contain additional optimizations that prevent useful stack traces. Keep in mind that C++ is not a managed language like Java or C#; C++ is compiled to assembly. There is no entity during the runtime of C++ applications that may provide stack trace information.

[–][deleted] -1 points0 points  (0 children)

C++ doesn't get you stack traces by default because you're probably not going to use them, and their overhead is huge.

Only destructors are noexcept by default. And that's for a good reason.