Article

C++ futures part 5: std::future and std::shared_future

The Old New Thing ·The Old New Thing ·Published 2026-10-16 ·5 min read

This article wraps up the introduction to the C++ futures library, focusing on std::future and std::shared_future. It explains how std::future is a move-only class designed for a single consumer, while std::shared_future allows multiple consumers to access the same value.

From the article

Wrapping up our quick introduction to the C++ futures library , we come to the last two parts: std:: future and std:: shared_future .

The std:: future is the starting point. It is a move-only class that this takes the source and forwards its wait and wait_for methods to the source , and forwards its get method to consume .

Forwarding the get to consume means that you can call get only once.


Share this resource


Discovered 2026-10-19 Source The Old New Thing Archive 2026-10 →