C++ futures part 5: std::future and std::shared_future
Permanent link:
cppdashboard.dev/r/2026/10/cpp-futures-part-5-std-future-and-std-shared-futureThis 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