~/talk

A Practical Introduction to C++20's Modules

slides:none on file

Practical walk-through of C++20 modules using Visual Studio 16.8/16.9 shows how to write .ixx module interface units, separate implementation units, and import the standard library via header units (standard library guaranteed); demo compiles and runs, and fmt worked as a header unit in the demo. Highlights: macros become module-local, non-exported symbols get module linkage, and name collisions in the global namespace can make the program ill-formed, no diagnostic required; MSBuild support is good, GCC/Clang are partial and CMake lacks official support.

AI-written summary · about

  1. 0:00VIRTUAL EVENT A Practical Introduction to C++20's Modules
  2. 3:41Modular Programming Modules separate a program into independent and interchangeable units • Modules hide the actual implementation and possibly data and • A module is not a package
  3. 29:48Module Names A number of identifiers joined by does
  4. 31:31Modules and Namespaces
  5. 34:34Module Partitions
  6. 36:44Private Module Fragment • Keep interface and implementation separate without having multiple files • modification of the private module fragment cannot trigger recompilation of importers of the module • Possibly faster incremental buids
  7. 40:23Global Module Everything must be attached to a module declared in a module
  8. 41:12What Can Be Exported? variables classes, structs, functions, namespaces, template function classes, concepts
  9. 43:47Implicit Exports
  10. 47:39include and modules including a header in the module purview is not a good idea
  11. 49:05Global Module Fragment . Only preprocessor directives allowed • Declarations not used in the named module are discarded and not • Use for headers which rely preprocessor state from the includer
  12. 50:21Header Units
  13. 52:11Advice for Headers Your own header. Try to convert it into a module including in the global module fragment
  14. 53:10Advantages encapsulation and information hiding
  15. 55:24Advice Visual Studio users: Use and leam modules with small hobby side projects all others: Wait for compiler and build system support
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.