C++ Modules - Getting Started Today

Andreas Weis

⏱ 90 minute session
beginner
intermediate
14:30-16:00, Saturday, 20th April 2024
Modules have been one of the most highly anticipated features of C++20. Unfortunately, it was also the language feature that took the longest to become widely available for developers to use. This year for the first time we see broad support for the feature in all major compilers and mainstream build system support through CMake. The goal of this talk is to provide you with all the basic knowledge to allow you getting started with C++20 modules today.

We will take a look at how modules change the build process and why it took so long to implement them. We will take a tour of the essentials of the named modules mechanism and explore the new best practices for physical code structure in a modules-based code base, including how to set up a build with CMake. And last but not least, we will discuss different options for interacting with existing header-based code.

The talk will focus above all else on practicality: We will only be covering features that are widely available for use today with the latest compilers and build tools. We will give special attention to the areas where the design practices for modules differ from the familiar header-based approach and address common misconceptions and pitfalls that are typical among developers first encountering the feature. No prior knowledge of modules is required.

🏷 build systems
🏷 modules
🏷 C++20

Andreas Weis

Andreas Weis has been writing C++ code in many different domains, from real-time graphics, to distributed applications, to embedded systems. His current focus is on writing software for safety-critical systems, in particular in the context of automotive software. He is an active member of the ISO C++ committee and the MISRA C++ working group. Andreas is also one of the co-organizers of the Munich C++ User Group.

He currently works for Woven Planet as a software architect for embedded automotive software.