2024 Update: C++ Modules - C++ Developers Get Started Today!
summary
Modules are usable now but require careful setup: mainstream compilers and CMake land in 2024 with CMake 3.28, clang 17 and MSVC toolset 1934 (GCC still often needs trunk, Ninja ≥1.11). Builds scan imports then compile, so compilation can run twice and the build graph must respect BMI dependencies. Binary module interfaces are fragile so BMIs must be distributed as source or rebuilt for consumers. Practical tips: use file sets, global module fragment for includes, partitions and export/import re-exports; expect bugs but real projects already work.
AI-written summary · about
chapters (14)
- 0:00C++ modules overview
- 3:59Header-based C++ problems
- 9:38What are C++ modules
- 17:23Exporting names in modules
- 21:00Module interface units
- 24:53Module partitions benefits
- 29:08Header units limitations
- 30:33Building modules with CMake
- 41:50Build system challenges
- 54:46Tips for modules
- 1:05:02Mixing includes and imports
- 1:13:33Macros and libraries with modules
- 1:20:01Distributing modules
- 1:26:07Conclusion and future
related talks
58mKnockin' on Header's Door: An Overview of C++ Modules
01h 00mSo, you want to use C++ Modules ... cross-platform?
01h 01mPractical C++ Modules
01h 07mBuilding C++ Modules
58mSo, You Want to Use C++ Modules … Cross-Platform?
34mPractical C++20 Modules and the future of tooling around C++ Modules
59mC++ Modules
01h 11mA Practical Introduction to C++20's Modules
