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';
More input, exceptions and threads commands
- Read a file line by line
- Read a line from the keyboard
- Handle exceptions
- Run code on another thread
- Share a counter between threads
- Time a section of code
All input, exceptions and threads commands · C++ 23 cheatsheet