Chapter 16. C++20 Modules: Large-Scale Development

Images

Objectives

In this chapter, you’ll:

Understand the motivation for modularity, especially for large software systems.

See how modules improve encapsulation.

import standard library headers as module header units.

Define a module’s primary interface unit.

export declarations from a module to make them available to other translation units.

import modules to use their exported declarations.

Separate a module’s interface from its implementation by placing the implementation in a :private module fragment or a module implementation unit.

See what compilation errors occur when you attempt ...

Get C++20 for Programmers, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.