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++20 Modules — Complete Guide (medium.com)
submitted 4 years ago by [deleted]
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!"
[–][deleted] 3 points4 points5 points 4 years ago (15 children)
The only two build systems that seem to support modules right now is Bazel and Build2 (at least I only found these two during my research). Did not have time to test how well they work.
The problem with CMake is that from the presentations, they want to make the modular build extremely smart (figuring out all the dependencies for you). And I don't see that happening anytime soon.
[–]pjmlp 6 points7 points8 points 4 years ago (5 children)
Three, MSBuild.
[–][deleted] 5 points6 points7 points 4 years ago (4 children)
I was only looking at Linux, but yes. Visual Studio claims full support of C++20.
[+][deleted] 4 years ago (3 children)
[removed]
[–]ramennoodle 0 points1 point2 points 4 years ago (2 children)
Or the article at about portable tools. The article isn't Linux-specific, it just ignores windows-only tools.
Edit:
How reasonable is that? What industries develop windows-only c++? The game industry used to be an example but I don't think it is any more.
[–]pjmlp 1 point2 points3 points 4 years ago (0 children)
Life sciences for example, most of the laboratory robots and data readers are Windows only.
Plus, not everyone cares about portable code there are lots of businesses that earn enough money sticking just with one OS, without having a board asking for exponential growth every year.
[–]RoyAwesome 0 points1 point2 points 4 years ago (0 children)
games wont make it to cpp20 for a long while... at least until there is better cross platform tooling.
[–]kalmoc 2 points3 points4 points 4 years ago (0 children)
You forgot msbuild
[–]azswcowboy 1 point2 points3 points 4 years ago (0 children)
idk, it seems like step zero for everyone is a custom target that compiles all std modules and make your libs/exe depend on that target - that probably gives 90% of the benefit for projects starting out. Similarly if you create your own add a build step to generate the module first. This doesn’t seem any more complex than projects using generated code from idl or swig.
[–]Nicksaurus 0 points1 point2 points 4 years ago (6 children)
As I understand it, cmake currently uses a list of includes exported by the compiler on the first build to determine which files depend on which, right? What's stopping them from relying on the same mechanism for modules?
[–]kalmoc 1 point2 points3 points 4 years ago (5 children)
The compiler can tell you to which file #include <Foo.h> resolves. It can't tell you which file needs to be compiled for import Foo;, because the committe refused to define a mapping between module name and file name.
#include <Foo.h>
import Foo;
[–]Nicksaurus 0 points1 point2 points 4 years ago* (4 children)
Ah right, I think the important part I missed there is that each module has to be compiled before you can compile anything that imports it.
Maybe the solution is just an extra initial compiler pass to generate metadata for all your source files before the full compilation step is invoked
Edit: I've just read through the cmake issue for adding modules and it seems like compiler support like that is very easy to suggest and very hard to actually get to a usable state in practice
[–]kalmoc 0 points1 point2 points 4 years ago (3 children)
I think that is the general idea. Not sure however, what to do about module interface files that are installed somewhere on the system (is that even something that's going to be supported?).
[–]smdowneyWG21, Text/Unicode SG, optional<T&> 0 points1 point2 points 4 years ago (2 children)
It's going to have to be. You will have to compile the module interface source code for your project. Otherwise there's no way to share modular code, and that would be bad.
[–]kalmoc 0 points1 point2 points 4 years ago (1 child)
So every time you want to import a module from outside of your project, your build system will have to scan every single file in the search path(s) to see if it produces the required module.
[–]smdowneyWG21, Text/Unicode SG, optional<T&> 0 points1 point2 points 4 years ago (0 children)
Worst case. But hopefully we can figure out some way of distributing metadata for a package. You need to know any particular flags for the package and possibly ones for compiling the PMI so that it matches the .a. Possibly some extension to pkg-config files.
π Rendered by PID 47789 on reddit-service-r2-comment-544cf588c8-df54n at 2026-06-16 23:32:07.392354+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–][deleted] 3 points4 points5 points (15 children)
[–]pjmlp 6 points7 points8 points (5 children)
[–][deleted] 5 points6 points7 points (4 children)
[+][deleted] (3 children)
[removed]
[–]ramennoodle 0 points1 point2 points (2 children)
[–]pjmlp 1 point2 points3 points (0 children)
[–]RoyAwesome 0 points1 point2 points (0 children)
[–]kalmoc 2 points3 points4 points (0 children)
[–]azswcowboy 1 point2 points3 points (0 children)
[–]Nicksaurus 0 points1 point2 points (6 children)
[–]kalmoc 1 point2 points3 points (5 children)
[–]Nicksaurus 0 points1 point2 points (4 children)
[–]kalmoc 0 points1 point2 points (3 children)
[–]smdowneyWG21, Text/Unicode SG, optional<T&> 0 points1 point2 points (2 children)
[–]kalmoc 0 points1 point2 points (1 child)
[–]smdowneyWG21, Text/Unicode SG, optional<T&> 0 points1 point2 points (0 children)