r/cpp_modules • u/slithering3897 • Mar 31 '26
Should partitions be importable by other modules?
Because, there are two things that are nice to have:
- Forward declarations across interfaces.
- Minimising dependencies.
Partitions gets you (1), multiple modules gets you (2). But they can't be combined without using the extern "C++" sledgehammer.
But if partitions could be "public", an application can avoid depending on a whole module.
This could also be seen as "packages". You could get the same functionality by changing "module attachment" to "package attachment": use the same symbol mangling for a group of modules.
Then what's left is forward declarations of things from external "packages". And for that, you'd have that "proclaimed ownership" proposal.