
Course introduction
Course slides
Introduction to aggregate initialization introduced in C++17.
Designated initialization examples.
More examples of designated initializers. Comparison & differences with C designated initializers.
Internals of the range for loop and its working.
Issues due to looping over a temporary range.
Introduction to the new char8_t type for UTF-8 characters.
Usage of char8_t type for UTF-8 characters.
Limitations of structured bindings before C++20 and how C++20 overcomes those limitations.
New changes to constexpr keyword.
Concept of an immediate function that is executed at compile-time.
Initialization of global variables at compile-time through constinit specifier.
Overview of explicit specifier and the issues we face with some library classes.
Making a constructor conditionally explicit through SFINAE (std::enable_if).
The new conditional explicit specifier and how it can make a constructor explicit based on a compile-time condition.
Deprecation of the implicit capture of this in a lambda expression.
Understand the meaning of evaluated & unevaluated context and how that is relevant to lambda expressions.
C++20 adds the ability to use user-defined non-type template parameters as a template argument now, including floating-point types. However, this class must have a constexpr constructor. Learn more about this feature in this lecture.
Understand the limitations of using generic lambdas.
C++20 introduced "template type parameters' for lambda expressions. Learn how they solve certain issues with lambdas and simplify code.
Source code for this section
Learn how C++ 20 enables using declarations for both scoped and unscoped enums, bringing enumerators into scope to improve readability and reduce code noise, as shown with color and toString.
Source code for this section
Introduction to C++98 style formatting using manipulators
More examples of formatting using manipulators
Introduction to the C++20 formatting library
Basic usage of std::format function.
Implementation of the println helper function to avoid repetitive usage of cout and endl.
Note: The newline implementation in this function is missing in this lecture but has been fixed in subsequent lectures.
Explanation of the format specification type.
Explanation of the format specification for fill, alignment & width.
Explanation of the format specification for number formatting.
Explanation of the format specification locale that is used for internationalizing your applications.
Learn about why we need to apply constraints on the type of arguments in templates
Learn about the basics of concepts and the requires keyword
Apply concepts to the function templates implemented earlier
Different ways concepts can be used and applied on templates
Use auto as parameter type to apply the constraints on the parameters
Different ways in which requirements can be specified on templates. This lecture discusses simple & compound requirements.
This lecture discusses nested & type requirements.
Combine requirements to create more complex requirements.
More examples of usage of concepts
Source code.
Learn how C++20 modules replace header files to enable modularization via translation units and libraries. Trace the build steps—preprocessing, compilation, linking—and compare header distribution with libraries to protect code.
Name modules to prevent conflicts by prefixing with your company and using a dot as separator. Visual Studio offers experimental support to import the standard library as a module.
Source code
Explore how the compiler rewrites relational and equality expressions using the three-way comparison operator in C++20, producing an ordering type and boolean results via comparisons with zero.
Understand strong ordering, the strongest three-way comparison outcome, with its four values—less, equal, equivalent, and greater—and how integrals and strings use its relational operators.
Demonstrate partial ordering in c++ 20 by building a pair class with memberwise three-way comparison returning partial ordering values (less, greater, equivalent, unordered) and discuss operator equality and default specifier.
Learn how to use the three-way comparison operator with C++20 classes, ensuring backward compatibility when nested types lack the operator, by specifying explicit ordering with strong ordering.
Explore lexicographical compare three way to compare array ranges with static arrays, using std::compare_three_way, custom compare objects, and strong or weak ordering fallbacks for non-three-way types.
Source code
Explore why ranges were added in c++20 and how the ranges library simplifies applying algorithms to containers via iterators, with examples like generate, for each, find, and sort.
Explore how views in the C++ ranges library provide lightweight, non-owning, lazily evaluated views into ranges with reference semantics for filtered data.
Demonstrate using view adapters to flatten a string vector with join view and split strings with split view, contrasting pre c++ 20 techniques with c++23 join with string views.
Pure C++20 Mastery is a comprehensive, standards-focused deep dive into the C++20 language and standard library.
Unlike most courses that combine older C++ standards with a brief C++20 overview, this course is entirely dedicated to C++20 — covering core language features, new library utilities, concurrency primitives, and the programming models introduced in this standard.
This course assumes some familiarity with modern C++ (C++11/14/17).
It does not repeat language fundamentals, object-oriented basics, or pre-C++20 material.
Core C++20 language features
You will learn all major C++20 language additions, including:
consteval and constinit
Designated initializers
Lambda improvements, including usage in unevaluated contexts
Modern enum enhancements
The three-way comparison operator (<=>) and defaulted comparisons
These features are explained in terms of design intent, correct usage, and real-world implications.
Modules — a new compilation and reuse model
C++20 introduces modules, fundamentally changing how C++ code is structured and reused.
This course covers:
Why modules were introduced
How they differ from header-based designs
How to define, export, and import modules
Build-time, dependency, and architectural implications
Practical limitations and current tooling realities
Ranges — algorithms redesigned
C++20 ranges are not just syntactic sugar.
You’ll gain a deep understanding of the ranges model, including:
Views and lazy evaluation
Range adaptors and composition
Eliminating iterator boilerplate (begin() / end())
Writing safer, more expressive algorithm pipelines
Performance and correctness considerations
Concepts — constraints done right
Concepts introduce a clean, expressive way to constrain templates.
You’ll learn:
Why concepts replace many SFINAE patterns
Concepts vs enable_if
Writing meaningful constraints
Improving compile-time diagnostics
Designing robust generic interfaces
Coroutines — resumable functions and cooperative concurrency
C++20 coroutines introduce a new execution model based on suspendable and resumable functions.
This course explains:
Coroutine mechanics and execution flow
Promise types, awaitables, and suspension points
How coroutines enable asynchronous and cooperative concurrency
How coroutines relate to threads and executors
When coroutines are appropriate — and when they are not
C++20 concurrency & synchronization utilities
In addition to language features, this course provides in-depth coverage of new C++20 concurrency facilities, including:
std::jthread and cooperative cancellation
Stop tokens and structured thread lifetime management
Modern synchronization primitives introduced or enhanced in C++20 such as latch, barrier & semaphore.
Safer, more expressive concurrency patterns enabled by the new library design
This section focuses on why these utilities were added, how they improve correctness, and how they change modern C++ concurrency design.
New and updated C++20 library utilities
You will also explore important C++20 standard library additions, such as:
Formatting facilities (std::format)
New utility types and helper classes such as std::osyncstream, std::source_location, std::span, etc.
Library changes that complement ranges, concepts, and coroutines
Practical usage patterns and limitations
These topics are often skipped or briefly mentioned in other courses — here they are treated as first-class C++20 features.
Update [12-Dec-2024] Added content on new C++20 library features & classes
Update [07-Dec-2024] Added concurrency support videos
Update [26-Nov-2024] Added quiz for all sections
Update [09-Nov-2024] Added more videos with examples of views in Ranges section