From 08acb8036ee3b3d4cb1da247a5841ad18f677b52 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 7 Dec 2017 16:01:26 +0100 Subject: [PATCH] Add explicit keyword to simgrid::kernel::Future constructor. --- include/simgrid/kernel/future.hpp | 2 +- include/simgrid/simix/blocking_simcall.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/simgrid/kernel/future.hpp b/include/simgrid/kernel/future.hpp index 3a3f29c2c2..d1ec120beb 100644 --- a/include/simgrid/kernel/future.hpp +++ b/include/simgrid/kernel/future.hpp @@ -282,7 +282,7 @@ template class Future { public: Future() = default; - Future(std::shared_ptr> state) : state_(std::move(state)) {} + explicit Future(std::shared_ptr> state) : state_(std::move(state)) {} // Move type: Future(Future&) = delete; diff --git a/include/simgrid/simix/blocking_simcall.hpp b/include/simgrid/simix/blocking_simcall.hpp index a856eca0ee..8cd2eee73f 100644 --- a/include/simgrid/simix/blocking_simcall.hpp +++ b/include/simgrid/simix/blocking_simcall.hpp @@ -59,8 +59,8 @@ auto kernelSync(F code) -> decltype(code().get()) simcall_run_blocking([&result, self, &code]{ try { auto future = code(); - future.then_([&result, self](simgrid::kernel::Future value) { - simgrid::xbt::setPromise(result, value); + future.then_([&result, self](std::shared_ptr>&& value) { + simgrid::xbt::setPromise(result, simgrid::kernel::Future(value)); simgrid::simix::unblock(self); }); } @@ -94,9 +94,9 @@ public: simcall_run_blocking([this, &result, self]{ try { // When the kernel future is ready... - this->future_.then_([&result, self](simgrid::kernel::Future value) { + this->future_.then_([&result, self](std::shared_ptr>&& value) { // ... wake up the process with the result of the kernel future. - simgrid::xbt::setPromise(result, value); + simgrid::xbt::setPromise(result, simgrid::kernel::Future(value)); simgrid::simix::unblock(self); }); } @@ -124,9 +124,9 @@ public: simcall_run_blocking([this, &exception, self]{ try { // When the kernel future is ready... - this->future_.then_([this, self](simgrid::kernel::Future value) { + this->future_.then_([this, self](std::shared_ptr>&& value) { // ...store it the simix kernel and wake up. - this->future_ = std::move(value); + this->future_ = std::move(simgrid::kernel::Future(value)); simgrid::simix::unblock(self); }); } -- 2.20.1