Boost logo

Boost Users :

Subject: Re: [Boost-users] future<>.then and promises
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2013-06-28 14:39:49


On Fri, Jun 28, 2013 at 7:48 PM, Vicente J. Botet Escriba <
vicente.botet_at_[hidden]> wrote:

> When I fix it, the continuation would not be called immediately but as the
> doc states it should
>
> "- If the parent was created with promise<< or with a packaged_task<>(has no associated launch policy), the continuation behaves the same as the
> third overload with a policy argument of launch::async | launch::deferredand the same argument for func.
> "
>
>
Ah yes, ok, so it will be called at least when future.get() will be called,
if I understood correctly?

> 1.
>
> ft.then( []( future<T> f ) { return 42; } );
>
> This will not compile (VS2012U3) because there is an attempt to copy
> future<T> (which looks like a bug I reported where returning a future would
> trigger copy instead of moving the future, bug fixed since then so I'm a
> bit surprise about this one)
>
> Currently the prototype of a continuation takes a future by reference,
> but I could change it to by value (which need to move the future.
>

I thought the original standard proposition was moving the future into the
callback, or is this point under discussion?

Joel Lamotte



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net