C++ 23 · Input, exceptions and threads

Compute a value in the background

Run a function asynchronously and collect the result later.

auto fut = std::async(std::launch::async, [] { return 6 * 7; });
std::cout << fut.get() << '\n';

Official C++ 23 documentation

More input, exceptions and threads commands

All input, exceptions and threads commands · C++ 23 cheatsheet

Was this page helpful?