In C++, the embodiment of a source unit is the translation unit. In simple words, we can call it the C++ source file.
Now, with the introduction of modules, we have a new type of translation unit called the module unit.
The impact is immediate !
When we write legacy-free modern C++20 code, we can now choose to write a module instead of a header file. We can now create a type-safe binary artifact instead of relying on macro hackery, C pre-processor and header file.
There is much more to modules and a lot of innovation is possible. As we evolve this article, stay tuned for the details.
C++20 Modules presentation
Florian et' al presentation on C++20 Modules at GNU Tools Track (day 2), Linux Plumbers Conference 2020.
- C++ modules paper P1103r3
- P1103r3 merge to C++ draft
- C++20 Modules, a brief tour
- C++20 Modules, LPC 2020
- GCC C++20 Modules Wiki
image credit: FSF, GNU, GCC project.