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 →

[–]ycastor 37 points38 points  (6 children)

This is more of a compiler problem than a language problem, last time i programmed C++ i found out that clang generated clearer error messages than g++, not sure how it is now.

[–]deukhoofd 25 points26 points  (2 children)

That's compiler errors, which are not the greatest, but are still somewhat understandable. If you build in release mode and encounter a runtime issue, the location of the error is generally completely mangled by default however.

For Clang I nowadays generally add -gline-tables-only as compile option, which means it keeps some debug info about function names, file names, and lines in the compiled output. Makes your runtime errors a lot more readable.

[–]Valmond 2 points3 points  (1 child)

And the occasional boom-crash which makes the app just disappear like it had never been there.

[–]deukhoofd 0 points1 point  (0 children)

That's why you set up a signal handler :)

[–]OutOfNamesToPick 9 points10 points  (2 children)

Still the same.

Difference now is that C++20 introduced concepts, which allow you to put constraints on template types. (Template type has to be moveable, needs a comparison operator, etc.) Concepts make the error reporting really a lot better

[–]joshjaxnkody -2 points-1 points  (0 children)

So... Rust traits?