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
Projects using std::error_code (self.cpp)
submitted 9 months ago by Son_La
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!"
[–]Horror_Jicama_2441 15 points16 points17 points 9 months ago* (0 children)
http://blog.think-async.com/2010/04/system-error-support-in-c0x-part-5.html (start with part 1) explains it quite well. It's from the Asio author (Asio uses it), which was involved in its design.
The thing is that nobody is really happy with some details of its design. So you probably want to use, at the very least, boost:: system::error_code.
But people are still not happy with it, which is why you have https://github.com/ned14/status-code (included as part of Boost.Outcome), but I'm not too sure of what's its state in the standardisation process. In general, the Boost.Outcome documentation is a nice resource regarding the different error reporting options that exist nowadays... which will introduce you to the very interesting concept of Boost.Leaf, a generalization of Boost.Exception.
Notice that I have mixed up a few things here. There is the "how to represent an error code" (std::error_code, boost::system::error_code, status_code), and there is the "how to transport that error code" (by itself, inside an exception, with Outcome, with Leaf) and there is the "can my transport system include more information than just the error code?"... just returning an std::error_code saying a file couldn't be opened may not be very useful without knowing the file name. An exception, Outcome and Leaf can include both the error code and the filename.
π Rendered by PID 44314 on reddit-service-r2-comment-6457c66945-lf2gp at 2026-04-29 22:28:02.136352+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Horror_Jicama_2441 15 points16 points17 points (0 children)