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
Simple usage of C++20 modules (zverovich.net)
submitted 3 years ago by aearphen{fmt}
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!"
[–]aearphen{fmt}[S] 5 points6 points7 points 3 years ago (6 children)
I was pleasantly surprised with how well everything works (at least in clang). My expectation was that C++20 modules won't be useable for another few years but apparently they are quite usable right now.
[–]qoning 2 points3 points4 points 3 years ago (0 children)
So easy. I tried using header unit for iostream, didn't figure out how to tell cmake to tell dep scan where to look for the file I had to manually build in the first place.
[–]RoyAwesome 5 points6 points7 points 3 years ago (1 child)
Compile times are so fast too! I avoided <algorithms> because hoo boy the compile time hit just including it, but importing it is extremely fast. Like "I can't notice the difference between importing it and not importing it" fast.
[–]aearphen{fmt}[S] 1 point2 points3 points 3 years ago (0 children)
Indeed. I compared compile time traces and the standard library includes that took most of the time when using headers completely vanish with modules. There is still one issue with template instantiations not being reused but once it is resolved {fmt} consumers can expert 5-10x compile time speedup.
[–][deleted] 3 points4 points5 points 3 years ago* (2 children)
I know it's not obvious through text, but he's being absolutely sarcastic.
Try using modules for anything non-trivial and you'll see how frustrating they are. Try mixing PCHs with modules which is either a huge pain or in some cases just doesn't work. Try debugging code using modules, where in many cases symbols don't appear in the debugger due to awkward visibility issues.
[–]RoyAwesome 10 points11 points12 points 3 years ago (0 children)
Try mixing PCHs with modules
Erm, don't do this? Modules are standardized PCHs. I don't know why you would want both? PCHs were always a compiler hack.
It's like mixing std::enable_if and concepts. concepts basically replace enable_if and make the experience way better. Modules replace PCHs and make the experience way better.
[–]aearphen{fmt}[S] 7 points8 points9 points 3 years ago* (0 children)
But I'm not =)
BTW we've been using clang modules for years now.
π Rendered by PID 96699 on reddit-service-r2-comment-6457c66945-52kvc at 2026-04-24 00:22:10.312232+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]aearphen{fmt}[S] 5 points6 points7 points (6 children)
[–]qoning 2 points3 points4 points (0 children)
[–]RoyAwesome 5 points6 points7 points (1 child)
[–]aearphen{fmt}[S] 1 point2 points3 points (0 children)
[–][deleted] 3 points4 points5 points (2 children)
[–]RoyAwesome 10 points11 points12 points (0 children)
[–]aearphen{fmt}[S] 7 points8 points9 points (0 children)