r/cpp_modules • • Apr 09 '26

C++ Modules: Internal Partitions

https://abuehl.github.io/2026/04/09/internal-partitions.html

A summary of what internal partitions are (according to the C++ standard). I tried to be precise, without reaching for standardese.

1 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/Ateist Apr 10 '26 edited Apr 10 '26

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.

They had to inspect only the file at hand and its included files - all the information obtained from the file they are inspecting.

Now they have to inspect ALL the files to find out where the "module" it is importing came from.
Which essentially turns them into compilers themselves...

The BMI contains only descriptions of things like types and function declarations,

If POSIX or LPTHREAD makes a difference (as I have experienced) they contain more than that.

1

u/tartaruga232 Apr 10 '26

All major compilers have agreed to output a file which contains the dependency info that was collected while scanning for modules in source files.

See https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1689r2.html

This was done by the CMake folks.