Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s4u::Exec now has 2 child classes
[simgrid.git] / include / simgrid / kernel / future.hpp
index 810e9dd..482497a 100644 (file)
@@ -291,6 +291,7 @@ class Future {
 public:
   Future() = default;
   explicit Future(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
+  ~Future() = default;
 
   // Move type:
   Future(Future&) = delete;
@@ -356,7 +357,7 @@ public:
         [](Promise<R> promise, std::shared_ptr<FutureState<T>> state, F continuation) {
           // ...set the new future value by running the continuation.
           Future<T> future(std::move(state));
-          simgrid::xbt::fulfill_promise(promise, [&] { return continuation(std::move(future)); });
+          simgrid::xbt::fulfill_promise(promise, [&continuation, &future] { return continuation(std::move(future)); });
         },
         std::move(promise), state, std::move(continuation)));
     return future;