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
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
This course only focuses on the new C++20 standard features without going into the basics or details of previous standards of C++ or basics of object-oriented programming. You must've some basic understanding of C++11 in order to follow through in this course. In case, you're not familiar with modern C++ features, check out my other course called Complete Modern C++.
This course will aim to explain the new core language & the library features. You'll learn to use designated initializers, consteval, consinit, unevaluated constext usage of lambda expressions, enum usage, etc. You'll also get to know about the new way through which C++ code is reused without using header files. This is possible through modules, which is a faster and easier way to reuse existing functions or classes.
If you implement classes for use with containers, then you'll have to provide implementation of many comparison operators which becomes tedious and error prone. C++20 provides a new operator called the three-way comparison operator (space-ship operator) that simplifies implementation of comparison operators. Additionally, it now becomes easier to use algorithms with containers through ranges. No need to use begin() & end() functions to operate on the container.
Concepts is a new way of applying constraints on template arguments. It is much simpler to use as compared to SFINAE (enable_if). Learn & implement concepts to ensure your functions accept the right kind of arguments and avoid runtime errors.
You'll learn about resumable functions, called coroutines. Using coroutines, you can write concurrent code without the need for synchronization or multiple threads. This enables you to write high performance code without the overhead of creating & destroying threads.
If you're ready, then let's get started right away.
More examples of designated initializers. Comparison & differences with C designated initializers.
Course introduction
Course slides
Introduction to aggregate initialization introduced in C++17.
Designated initialization examples.
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.
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.
Quiz for this section
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 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
Quiz for Lambda Expressions & More Language Features
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.
Quiz for this section.
Source code.
Test your knowledge of modules.
Source code
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.