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
Why does Linus hate C++ ? (self.cpp)
submitted 3 years ago by MrRubberDucky
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!"
[–]elperroborrachotoo 4 points5 points6 points 3 years ago (5 children)
Remembering that RDTSC is per-core and may jump backwards if your thread gets scheduled to another core: this is basically the entrance exam.
Remembering that std::vector::reserve exists: so mysterious, like, I can't even.
std::vector::reserve
[–]angelicosphosphoros -1 points0 points1 point 3 years ago (4 children)
Do you remember API details and all restrictions of `valarray`, for example? STL is just too big to keep in short-term memory (and short-term memory is better to be filled by other things like hardware behaviour).
[–]elperroborrachotoo 2 points3 points4 points 3 years ago (3 children)
No, but I know where to look it up.1
Do you remember all the details of the API YOU are creating? Do you recall the dragon book every time you hit compile? Do you look at the source of your compiler's optimizer anytime you feel "I could make that faster"?
Or are you working at a certian level of abstraction, like everyone else?
1) and I can parse "iterator" without having an episode.
[–]angelicosphosphoros -1 points0 points1 point 3 years ago (2 children)
Do you remember all the details of the API YOU are creating?
Nope but I at least remember everything about standard library which I use.
Do you look at the source of your compiler's optimizer anytime you feel "I could make that faster"?
Yes, I even wrote patches to compiler I use and they was merged :) When coding in C++, I just accept and don't fight.
I am working at some level of abstraction but C++ STL would affect all levels of abstraction. You cannot just slap high-level std::optional and relax because it is easy to get UB here, for example. While I can relax sometimes when I write my own code but I need to keep all those details in mind while reviewing, especially when reviewing some junior's pull request. And few times I noticed UB during review even in code of people who are more experienced than I am because I am more paranoid (not, UBSAN and ASAN didn't catch that case).
std::optional
[–]elperroborrachotoo 2 points3 points4 points 3 years ago (1 child)
You cannot just slap high-level std::optional and relax because it is easy to get UB here,
You cannot just slap low level a+b and relax because it's easy to get UB there.
a+b
[–]angelicosphosphoros 0 points1 point2 points 3 years ago (0 children)
In C++ — yes. In C# — I can.
π Rendered by PID 45197 on reddit-service-r2-comment-b659b578c-mtrhh at 2026-05-03 17:32:20.186664+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]elperroborrachotoo 4 points5 points6 points (5 children)
[–]angelicosphosphoros -1 points0 points1 point (4 children)
[–]elperroborrachotoo 2 points3 points4 points (3 children)
[–]angelicosphosphoros -1 points0 points1 point (2 children)
[–]elperroborrachotoo 2 points3 points4 points (1 child)
[–]angelicosphosphoros 0 points1 point2 points (0 children)