samedi 21 juillet 2018

std::async(std::launch::deferred) + std::future::then

The idea behind a deferred future is that the callback is called only when someone tries to wait or to pull the futuristic value or exception of the future. by then the callback is not executed.

what happens if I attach a continuation to a deferred future with std::future::then? the deferred future is lost (then invalidates the future) and a new future is achieved.

In this case, according to the standard, what should happen? is the new future is a deffered future as well?

Aucun commentaire:

Enregistrer un commentaire