Language
Compiler
Options
#include <iostream>
#include <boost/thread/future.hpp>
int main()
{
using namespace boost;
promise<int> p;
future<int> f = p.get_future();
p.set_value(5);
int a = f.get();
int b = f.get();
std::cout << a << std::endl;
std::cout << b << std::endl;
}
$
5
5
Exit Code:
0