Converting to C++20 Modules
summary
Converts tinyxml2 using GCC experimental modules to show an incremental path: create a header unit mapping file, generate a CMI (compiled module interface), tweak the Makefile to feed include-translation, then replace #include with import and fix errors from missing stdio and macro visibility. Resolves internal-linkage and export scope issues, folds implementation into a single interface module, and runs the original tests successfully. Repository contains the commit-by-commit conversion and the exact build flags used.
AI-written summary · about
chapters (32)
- 0:00Introduction to modules
- 1:15GCC modules implementation
- 2:45Building unchanged code
- 3:31Module artifacts and dependencies
- 4:35Header units conversion
- 8:37Header unit compilation
- 10:23Header unit macro behavior
- 13:11Testing header unit conversion
- 14:43Explicit header unit import
- 15:50Named module structure
- 19:00Interface unit setup
- 20:23Implementation unit changes
- 21:06Build system updates
- 22:52Compilation errors and fixes
- 27:11Named module completion
- 27:54Single file module conversion
- 30:23Optimizing module structure
- 31:27Exporting specific symbols
- 33:17Repository and resources
- 33:39Distributing modules
- 35:07Dependency management
- 36:35Include to import conversion
- 38:02Module name collisions
- 39:07Conversion strategies
- 40:28System vs user modules
- 41:54Finding module interfaces
- 42:16Online compiler support
- 42:42Inspecting module files
- 44:30Build parallelism impact
- 46:16Private module access
- 47:46Friendship and module boundaries
- 48:30Q&A session
related talks
34mPractical C++20 Modules and the future of tooling around C++ Modules
59m“There and Back Again: An Incremental C++ Modules Design"
01h 11mA Practical Introduction to C++20's Modules
58mKnockin' on Header's Door: An Overview of C++ Modules
01h 00mAdding C++ modules-ts to the GNU Compiler
36mC++ Modules: Year 2021
59mC++ Modules
01h 10m“C++ Modules: The State of The Union"
