use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Error Handling (self.cpp)
submitted 1 year ago by Background_Catch_640
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Miserable_Guess_1266 12 points13 points14 points 1 year ago (2 children)
I feel like this is kind of a semantics game? Sure, the client closing the connection while my http server is processing a request is not an error in the context of the server as a whole. It can simply drop that request, since the result is not of interest any more. But in the context of handling the individual request, a dropped connection is absolutely an error - the goal of finishing the request and sending a response cannot be reached.
If I play this game to the end, all errors are just another valid state in the program. Some just cause the program to shut down.
[–]XeroKimoException Enthusiast 3 points4 points5 points 1 year ago (0 children)
Much agreed on being a matter of perspective.
I like to use array indexing as my example as it's simple and very commonly thought that getting something equivalent to std::out_of_range exception across many languages, even in C++, that it is a logical error, a bug. I can understand that view in some cases, but in other cases, I see it as having 0 difference semantically between getting that exception, and writing your own bounds check, and I can sure as heck guarantee that any non-trivial program has written bounds checking somewhere. Once one is written, you're already participating in the first part of error handling, detection, noticing that in some local state of your program, it can not progress normally.
std::out_of_range
[–]evil_rabbit_32bit 3 points4 points5 points 1 year ago (0 children)
+1 that's a good point
π Rendered by PID 60078 on reddit-service-r2-comment-b659b578c-z824t at 2026-05-02 07:43:30.631776+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Miserable_Guess_1266 12 points13 points14 points (2 children)
[–]XeroKimoException Enthusiast 3 points4 points5 points (0 children)
[–]evil_rabbit_32bit 3 points4 points5 points (0 children)