Submodules and Module Partitions

Learn the difference between submodules and module partitions.

We'll cover the following

When your module becomes bigger, you want to divide its functionality into manageable components. C++20 modules offer two approaches: submodules and partitions.

Submodules

A module can import modules and then re-export them.

In the following example, module math imports the submodules math.math1 and math.math2.

Get hands-on with 1200+ tech skills courses.