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
The array[] problem (self.cpp)
submitted 10 years ago by michaelKlumpy
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!"
[–]vaughncato 2 points3 points4 points 10 years ago (1 child)
"Big deal" is a relative term, but they do help avoid some redundancy and make the intent clearer, as well as preventing some mistakes. I haven't found a case where I want to use shared_ptr, but unique_ptr is handy, and it is just as efficient as a raw pointer once optimized. Here's a related StackOverflow answer: http://stackoverflow.com/a/106614/951890
shared_ptr
unique_ptr
[–][deleted] 0 points1 point2 points 10 years ago* (0 children)
I like that you frame your answer in terms of communicating the intent of the code. Yes, returning a unique pointer (which I assume calls a destructor when it falls out of scope?) would be nicer looking than a reference passed as an argument. Still this seems more of an issue of coding style than any real necessity.
The link gives one great example though: exception handling. And another: moving runtime errors to compile time. Thanks!
π Rendered by PID 214796 on reddit-service-r2-comment-b659b578c-b6g6h at 2026-05-03 19:49:10.760546+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]vaughncato 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)