25 May
2015
25 May
'15
6:04 p.m.
Niall Douglas wrote:
I've got everything working except the sequence:
promise<int> p; p.set_value(5); return p.get_future().get();
This should reduce to a mov $5, %eax, but currently does not for an unknown reason. I'm just about to go experiment and see why.
I'm really struggling to see how all that could work. Where is the result stored? In the promise? Wouldn't this require the promise to outlive the future<>? This doesn't hold in general. How is it to be guaranteed?