- Examples
In this lesson, we will look into the use of std::promise and std::future in the scope of concurrency in C++.
We'll cover the following...
We'll cover the following...
Example 1
Explanation
-
Thread
prodThread(line 36) gets the functionproduct(lines 8 -10), theprodPromise(line 32,) and the numbersaandb. -
To understand the arguments of
prodThread, we must look at the signature of the function.prodThreadneeds a callable as its first argument. This is the ...