X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f2a0c5fa3533c3cc23788659c72950a8da14bd8..3388e09cbb920fc3b904327f3b254f794e231ed1:/include/simgrid/kernel/future.hpp diff --git a/include/simgrid/kernel/future.hpp b/include/simgrid/kernel/future.hpp index e779c0ad63..6adfe664dd 100644 --- a/include/simgrid/kernel/future.hpp +++ b/include/simgrid/kernel/future.hpp @@ -327,8 +327,7 @@ public: throw std::future_error(std::future_errc::no_state); // Give shared-ownership to the continuation: auto state = std::move(state_); - state->set_continuation(simgrid::xbt::makeTask( - std::move(continuation), state)); + state->set_continuation(simgrid::xbt::make_task(std::move(continuation), state)); } /** Attach a continuation to this future @@ -347,15 +346,13 @@ public: Promise promise; Future future = promise.get_future(); // ...and when the current future is ready... - state->set_continuation(simgrid::xbt::makeTask( - [](Promise promise, std::shared_ptr> state, F continuation) { - // ...set the new future value by running the continuation. - Future future(std::move(state)); - simgrid::xbt::fulfillPromise(promise,[&]{ - return continuation(std::move(future)); - }); - }, - std::move(promise), state, std::move(continuation))); + state->set_continuation(simgrid::xbt::make_task( + [](Promise promise, std::shared_ptr> state, F continuation) { + // ...set the new future value by running the continuation. + Future future(std::move(state)); + simgrid::xbt::fulfillPromise(promise, [&] { return continuation(std::move(future)); }); + }, + std::move(promise), state, std::move(continuation))); return std::move(future); }