Understanding module partitions
The source code of a module may become large and difficult to maintain. Moreover, a module may be composed of logically separate parts. To help with scenarios such as these, modules support composition from parts called partitions. A module unit that is a partition that exports entities is called a module interface partition.
However, there could also be internal partitions that do not export anything. Such a partition unit is called a module implementation partition. In this recipe, you will learn how to work with interface and implementation partitions.
Getting ready
You should read the previous recipe, Working with modules, before continuing with this one. You will need both the module fundamentals we discussed there and the code examples that we will continue with in this recipe.
In the following examples, we will use the std
module, which is only available in C++23. For previous versions, use std.core
in VC++ or other particular...