Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

A Practical Introduction to C++20's Modules

ACCU Conference via YouTube

Overview

Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates
This talk introduces the practical use of C++20 modules and their advantages over header files. It covers module structure, project migration, compiler support, and build systems.

Syllabus

VIRTUAL EVENT A Practical Introduction to C++20's Modules
Modular 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
Module Names A number of identifiers joined by does
Modules and Namespaces
Module Partitions
Private 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
Global Module Everything must be attached to a module declared in a module
What Can Be Exported? variables classes, structs, functions, namespaces, template function classes, concepts
Implicit Exports
include and modules including a header in the module purview is not a good idea
Global 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
Header Units
Advice for Headers Your own header. Try to convert it into a module including in the global module fragment
Advantages encapsulation and information hiding
Advice Visual Studio users: Use and leam modules with small hobby side projects all others: Wait for compiler and build system support

Taught by

ACCU Conference

Reviews

Start your review of A Practical Introduction to C++20's Modules

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.