
14 Mar
2007
14 Mar
'07
8:05 p.m.
On Wed, 14 Mar 2007 15:50:34 -0400, Howard Hinnant wrote:
You could call this on a promise: result(f) and a promise_functor<R, F> would be returned as the result (I'm not at all very attached to the name promise_functor). Executing that functor would be roughly equivalent to setting the promise:
I believe this is similar to the 'class task' wrapper that Peter Dimov proposed in N2096 at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2096.html I think easy to use wrappers are a vital part of implementing future. I'm not sure I see a great advantage to putting the wrapper functionality directly within the promise class constructor though.