r/cpp_modules • u/tartaruga232 • Apr 09 '26
C++ Modules: Internal Partitions
https://abuehl.github.io/2026/04/09/internal-partitions.htmlA summary of what internal partitions are (according to the C++ standard). I tried to be precise, without reaching for standardese.
1
Upvotes
View all comments
Show parent comment
1
u/tartaruga232 Apr 10 '26
We do must view BMI files as cached compiler-specific byproducts of doing a build. The BMI contains only descriptions of things like types and function declarations, alas in a not standardized binary format, which is different for each compiler (although Microsoft published their *.ifc file format). In case you haven't noticed: A regular C++ module produces both a BMI file and an *.obj file. Modules can contain function definitions. These are compiled into the *.obj.
Static analysis tools do have to inspect the original C++ source files containing module interfaces and implementation. Like they already had to do for non-module C++ source code.
Library vendors do need to publish the C++ sources of the module interfaces bundled with their compiled library. Like they had to do before modules by publishing the header files that were required to use their library. C++ sources which are not reachable (see https://eel.is/c++draft/module#reach) from external C++ module interfaces don't need to published.
I think many people have some misunderstandings what to expect from C++ modules. They still provide a lot of benefits, although they may be more complicated to understand, then first thought. Header files are no longer state of the art. They are still needed, but not for conveying canonical type info shared between translation units.
I still regularly freak out about some aspects of C++ modules. But I think they are already pretty usable as they are now. Although it can be really tough to be an early adopter. Sometimes, I'm asking myself whether I am the first one trying to use some details. Thanks!