Introduction to Extended Futures
Explore the concept of extended futures introduced in C++20 to improve upon the limitations of C++11 futures. Understand the differences between valid and ready states, and how new methods like unwrapping constructors, is_ready predicates, and continuations enable more composable asynchronous tasks in modern C++ concurrency.
We'll cover the following...
Tasks in the form of promises and futures have an ambivalent reputation in C++11. On the one hand, they are a lot easier to use than threads or condition variables; on the other hand, they have a great deficiency. They cannot be composed. C++20 will overcome this deficiency.
I have written about tasks in the form of std::async, std::packaged_task, or std::promise and std::future. The details are here: tasks. With C++20 we may get extended futures.
...