C++ - Modules (Advanced)

Overview

Estimated time: 50–70 minutes

Go beyond basics: header units, build system integration, and migration strategies from headers to modules.

Learning Objectives

  • Understand header units and how they differ from modules.
  • Plan migration from headers to modules with tooling support.

Prerequisites

Header units vs modules

Header units import existing headers as units; they are not authored module interfaces. They can speed builds but don’t provide the same hygiene benefits as authored modules.

Common Pitfalls

  • Mixing textual includes and imports without a plan can create inconsistent state across compilers.