Futures and Promises

Download c++ eBook

Introduction

Promises and Futures are used to ferry a single object from one thread to another.

A std::promise object is set by the thread which generates the result.

A std::future object can be used to retrieve a value, to test to see if a value is available, or to halt execution until the value is available.

Related Examples

Stats

84 Contributors: 2
Wednesday, May 10, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook