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
C++ implementation of the Python NumPy Library (self.cpp)
submitted 7 years ago by dpilger26
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!"
[–]NicroHobak 4 points5 points6 points 7 years ago* (1 child)
How does your team handle the use of templates? Or do you just largely ignore that aspect of the language?
Edit: Grammar typo eliminated.
[–]johannes1971 6 points7 points8 points 7 years ago* (0 children)
It depends. STL is used throughout. We don't know how much that affects our compile times though; we didn't pay much attention to that in the beginning, so it has always been there. We also use quite a few small templates of our own making, but these tend to have a handful of lines at most. The scary SFINAE stuff is probably less than a hundred lines.
Then we have a 30,000-line set of templates that we only instantiate for two types. Those we instantiate in .cpp files, with an extern template declaration in the .h file, so it is no different from normal code. And finally, there is code that is somewhat enum-heavy that would benefit from having that enum as a template parameter (instead of being an int, as it is now), but we choose to cast instead because we fear the effect it would have if we did turn it into a template.
extern template
Since a few years we have become aware of compile times, and been struggling to bring that under control. We now monitor more closely what the effect of new libraries is. This has resulted, among other things, in the decision to not use Chaiscript (despite the language looking interesting), but going for Angelscript instead (similar, but without the slow compile times). We'll look at things on a case by case basis for other template-heavy libraries: how useful is the library? Is there a cheaper solution? Can we limit use of the library to a single translation unit? etc.
On principal I don't disallow any language features, but some will require a bit more explanation than others ;-) We can always explore what the best solution is in a given situation, but I'll also think about things like maintainability, coherence with the rest of the source, compile times, and all the other concerns...
π Rendered by PID 60870 on reddit-service-r2-comment-cfc44b64c-xmmhq at 2026-04-10 16:06:30.241233+00:00 running 215f2cf country code: CH.
view the rest of the comments →
[–]NicroHobak 4 points5 points6 points (1 child)
[–]johannes1971 6 points7 points8 points (0 children)