From e7adecbeff2464c74cb15fc218092dda17e01dde Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 25 Jan 2019 10:02:52 +0100 Subject: [PATCH] [sonar] Don't use default capture for lambda. --- include/simgrid/simix.hpp | 4 ++-- include/xbt/future.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/simgrid/simix.hpp b/include/simgrid/simix.hpp index 7137598d14..b01db1492c 100644 --- a/include/simgrid/simix.hpp +++ b/include/simgrid/simix.hpp @@ -61,7 +61,7 @@ template typename std::result_of::type simcall(F&& code) // conveniently handles the success/failure value for us. typedef typename std::result_of::type R; simgrid::xbt::Result result; - simcall_run_kernel([&] { simgrid::xbt::fulfill_promise(result, std::forward(code)); }); + simcall_run_kernel([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward(code)); }); return result.get(); } @@ -91,7 +91,7 @@ smx_timer_t SIMIX_timer_set(double date, F callback) template inline smx_timer_t SIMIX_timer_set(double date, R(*callback)(T*), T* arg) { - return SIMIX_timer_set(date, [=](){ callback(arg); }); + return SIMIX_timer_set(date, [callback, arg]() { callback(arg); }); } #endif diff --git a/include/xbt/future.hpp b/include/xbt/future.hpp index e0f51f8d84..30d9240ba0 100644 --- a/include/xbt/future.hpp +++ b/include/xbt/future.hpp @@ -257,7 +257,7 @@ XBT_ATTRIB_DEPRECATED_v323("Please use xbt::fulfill_promise()") auto fulfillProm */ template inline void set_promise(P& promise, F&& future) { - fulfill_promise(promise, [&] { return std::forward(future).get(); }); + fulfill_promise(promise, [&future] { return std::forward(future).get(); }); } } -- 2.20.1