Why Modules?: It's not about build time
summary
Named modules shift C++ from build optimization to fine-grained control visibility by using module interface and implementation units, partitions, and a private fragment to hide internals while exporting only selected declarations. The compiler produces a BMI and mangles the module name into symbols, so ABI changes if an entity moves modules; compiled module interfaces are fragile across compiler flags and versions and can refuse to import. Dependency cycles are forbidden, forward declarations across modules are not allowed, and real examples like libfmt work but require careful build consistency.
AI-written summary Β· about
chapters (13)
- 0:00Introduction to modules
- 1:02Purpose and goals
- 2:08The problem with include
- 7:59Core benefits of modules
- 12:17Module syntax and structure
- 18:17Purview, export, and import
- 23:36Legacy and private fragments
- 26:44Reachability and partitions
- 30:24Managing project dependencies
- 36:28Advanced module techniques
- 39:11ABI and link-time impacts
- 45:24Testing strategies
- 48:41Q&A and conclusion
related talks
32mVisibility, Reachability, Linkage β The Three Secret Spices of C++ Modules
01h 30mC++ Modules and Large-Scale Development
01h 04mBuilding Modules
01h 01mLarge Scale C++ with Modules: What You Should Know
01h 04mProgramming with C++ Modules: Guide for the Working
01h 01mC++20 Modules - Review of the Current State of C++ Modules 2024
59mC++ Modules and Large-Scale Development
01h 30mC++ Modules and Large-Scale Development
