CppCon 2022 C++20’s Coroutines for Beginners -- Andreas Fertig
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2023!
C++20’s Coroutines for Beginners
by Andreas Fertig
Summary of the talk:
You've heard about this new feature in C++20, coroutines, but it's the first time you have encountered this term? Then this talk is what you're looking for. We start from the beginning with just "normal" functions. Next, we introduce coroutines.
Using them, we explore the various customization points C++ offers. We look at what the new keywords co_await, co_yield, and co_return are for.
Sadly, we also have to talk about how to write a generator for a coroutine since there is no STL part for that in C++20.
Another distinction we make is between cooperative and preemptive multitasking, opening the door for another beauty of coroutines, why we don't need locks.
By the end of this talk, you've learned what coroutines are and where you can use them.

You may have a class that you want to participate in RVO or NRVO, but you also don’t want it to be moved. For example, it may contain a std::mutex, which is not movable. But you nevertheless have to declare a move constructor. What can you do?
Sorting algorithms have been thoroughly studied. Kevlin Henney takes an unexpected paradigm journey into sleep sort.
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
std::move can allow the efficient transfer of resources from object to to object. Andreas Fertig reminds us that using std::move inappropriately can make code less efficient.
Is it possible to extend a value type in C++? Alf Steinbach describes how to extend enum values.
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held