Boost logo

Boost :

From: Simon Meiklejohn (simon.meiklejohn_at_[hidden])
Date: 2006-08-14 03:57:09


>
> > An explicit separation of concepts at this level of abstraction
> > seems useful in terms of recombination into higher level
> > libraries (e.g. ASIO and statechart, futures) and also useful
> > in their own right. Seems analogous to the STL separation of
> > algorithms/iterators/containers which has been deemed a good thing.
>
 <Oliver.Kowalke <at> qimonda.com> writes:
> Hmm - I would find it useful if defer_point::defer would return an
> future which could be used to transfer results and/or exceptions back to
> the caller.

Yes, that would be very useful. Do you have some code to do that?
Should we use code from the existing futures library in the vault?
I haven't looked at the asio code for a while. Does it offer futures?

Is there scope for making defer_point::defer not only return a future
value, but also directly take parameters and eliminate the slightly
cumbersome bind steps?
e.g.

int Add(int a, int b);
int one = 1, two = 2;
future<int> result = a_deferrer.defer( Add, one, two );
std::cout << result.get();
//or perhaps
future<int>result;
a_deferrer.defer( result, Add, one, two );
// or maybe
defer::do( a_deferrer, result, Add, one, two);

Cheers

Simon


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk