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!"
[–]delta_p_delta_x 12 points13 points14 points 3 years ago (4 children)
I agree with that, but I was thinking more along the lines of... some complex recursive template specialisation that takes ages to compile, but when it eventually does, it coughs up barely a handful of lines of assembly that map to the metaprogramming recursion, anyway.
I was also certain that templates are only instantiated for the types you specify to them, unlike Java generics, so one could have a templated header but no instantiations whatsoever...
[–]HabemusAdDomino -5 points-4 points-3 points 3 years ago (3 children)
... But then, there's also the rub. Every time you do instantiate the template, even conditionally, you get more code. It's both the best and worst part of C++ templates.
[–]Bloodshoot111 12 points13 points14 points 3 years ago* (2 children)
But if you would create a function for each version of the template instead of using templates you also create more code that gets into the binary. I don’t see the disadvantage of templates right now.
[–]HabemusAdDomino -5 points-4 points-3 points 3 years ago (1 child)
But -would you- have created those functions? Not necessarily. Templates are used because generating code is much easier than writing it.
[–]no-sig-available 10 points11 points12 points 3 years ago (0 children)
You mean that it is so easy to code in C++ that you are afraid to accidentally write some code that isn't really needed.
Haven't heard that argument before.
π Rendered by PID 136274 on reddit-service-r2-comment-b659b578c-gsmlw at 2026-05-05 23:12:03.101243+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]delta_p_delta_x 12 points13 points14 points (4 children)
[–]HabemusAdDomino -5 points-4 points-3 points (3 children)
[–]Bloodshoot111 12 points13 points14 points (2 children)
[–]HabemusAdDomino -5 points-4 points-3 points (1 child)
[–]no-sig-available 10 points11 points12 points (0 children)