On cppreference.com about modules it says about export
:
Module interface units can export declarations and definitions, which can be imported by other translation units. [ … ]
All declarations and definitions exported in the module interface units of the given named module will be available in the translation unit using the import declaration.
Guessing from that, I'd export
everything that users of the module want or need to use it. Everything not export
ed is an implementation detail of the module and none of the import
ers’ concern.
It also tells me that
a private module fragment [ … ] allows a module to be represented as a single translation unit without making all of the contents of the module reachable to importers.
What is the difference between putting something in the private module fragment than to just not export
ing it?
I guess there’s a difference between “available in the translation unit using the import declaration” and “reachable to importers”. But what is that difference from a practical point of view? As a guideline, when would I put something in the private module fragment and when just not exporting it?
(Highlight inside quotes by me.)