r/cpp • MSVC user, r/cpp_modules • Apr 13 '26

Let's bite the Bullet: Module Units shouldn't implicitly import anything

https://github.com/abuehl/docs/blob/main/no-implicit-import.md

The correct fix ... is to attack the root cause and stop implicitly importing the interface of module implementation units.

Adding yet another kind of partition is the wrong way to solve it.

20 Upvotes

34 comments sorted by

View all comments

Show parent comment

1

u/not_a_novel_account cmake dev Apr 14 '26

OP's proposal removes the implicit dependency of implementation units on the PMIU. No dependency, no rebuilds on PMIU-visible interface changes.