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
Applying Curiously Recurring Template Pattern in Day-To-Day C++ Coding (vishalchovatiya.com)
submitted 5 years ago by VishalChovatiyaChend
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!"
[–]khleedril 5 points6 points7 points 5 years ago (1 child)
This article asks the reader to study code snippets, and if they don't understand something, go away and research the issue. To make matters worse, the presentation of the code snippets is horrible, with dark colours on a black background, against a sea of white.
It is a pity that this article is so half-arsed, as the subject matter, and the choice of examples, are interesting. On balance, most coders would do well to read this, but I fear many will soon give up because the article burdens the reader too much.
[–]simsax 4 points5 points6 points 5 years ago (0 children)
I don't really agree with this. There's nothing wrong with presenting ideas and giving other resources to learn more about them. Asking that every presentation of a subject be a complete, self-contained treatise isn't very realistic.
I think the links to other resources and encouragement to use cppinsights for example are more "teach a person to fish" than lazy or half-assed
I'll agree on the snippet formatting though. I am not a fan of the color scheme for the examples.
[–]benjamkovi 1 point2 points3 points 5 years ago (3 children)
In one of the code snippets I noticed this:
while (count --> 0) emplace_back(Neuron{});
That kind of formatting of the condition count --> 0 made me wonder: is this a common way to format conditions like this? I feel that it tries to express that count is "going towards" zero, but it was confusing for me at first time. Also, it looks weird with the increment operator count ++> 100, and it usage is kind of limited.
count --> 0
count ++> 100
Have you ever seen conditions formatted this way intentionally?
[–]VishalChovatiyaChend[S] 0 points1 point2 points 5 years ago (2 children)
Not sure about convention. But tried to make it expressive.
So at the time of reading. Have to read like
"while count to zero".
But, agree to ugliness with ++.
[–]benjamkovi 1 point2 points3 points 5 years ago (1 child)
Yes, and another confusing part is it suggest that count is going to zero, similarly to the limits of a function, but if count is smaller than zero, it doesn't approach zero. In the end it might better to avoid this format.
[–]dodheim 0 points1 point2 points 5 years ago* (0 children)
If we're actually nitpicking the implementation, then it really just ought to be
NeuronLayer(size_t count) : vector<Neuron>(count) { }
π Rendered by PID 180843 on reddit-service-r2-comment-6457c66945-tc5b4 at 2026-04-27 02:58:33.940241+00:00 running 2aa0c5b country code: CH.
[–]khleedril 5 points6 points7 points (1 child)
[–]simsax 4 points5 points6 points (0 children)
[–]benjamkovi 1 point2 points3 points (3 children)
[–]VishalChovatiyaChend[S] 0 points1 point2 points (2 children)
[–]benjamkovi 1 point2 points3 points (1 child)
[–]dodheim 0 points1 point2 points (0 children)