|
Boost : |
From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2007-03-14 17:33:31
On Wed, 14 Mar 2007 15:50:34 -0400, "Howard Hinnant"
<hinnant_at_[hidden]> said:
> And am somewhat disappointed that the low-level worker function needs
> to be aware of promise.
In some cases you do want it to be aware of the promise if you chain
many async operations together, and only fulfill promise at the end of
the chain. However a simpler interface for the one-async-operation case
would be nice, I agree.
> What if there existed a:
>
> template <class R>
> template <class F>
> promise_functor<R, F>
> promise<R>::operator()(F f);
>
> This would be in addition to the current setter functionality in
> promise.
Hmm, I think I'd prefer a non-member function to make the distinction
between that act of settingthe promise and the act of composing another
function object clearer when reading the code. I don't see any
implementation reason to make it a member function - is there one?
Cheers,
Chris
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk