40 Years Of Evolution from Functions to Coroutines

Speaker: Rainer Grimm

Audience level: Beginner | Intermediate

The evolution of a callable stands for the evolution of C++. Here are the main evolution steps.

It all started with a function. Additionally, C++98 supports objects that behave like functions. These function-like objects are called function objects, and can have state.
C++11 added lambda expressions to the C++ standard. Lambda expressions behave like data and support in-place invocation and capturing of state. Lambdas can be generic in C++14, constant expressions in C++17, or templates in C++20.
C++20 generalizes the idea of something callable. Functions in C++20 are pausable and resumable. These generalized functions are known as coroutines and are the means of choice to program asynchronously.

Each step in this long evolution is way more than just a syntactic step. Each step empowers new and more powerful ways to solve challenging programming tasks.