From: Arnaud Giersch Date: Sun, 22 Dec 2019 15:45:41 +0000 (+0100) Subject: [sonar] This is still ot a forwarding reference. X-Git-Tag: v3.25~243 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6349eaf761d8c7b80db00d48217890c20931964e [sonar] This is still ot a forwarding reference. See https://rules.sonarsource.com/cpp/RSPEC-5417 ; completes commit a96793ec8c496eec19daf68f3aa0c4eded2ea166. I hope it's correct this time. --- diff --git a/include/xbt/functional.hpp b/include/xbt/functional.hpp index 1fefcd8473..d66763d7d9 100644 --- a/include/xbt/functional.hpp +++ b/include/xbt/functional.hpp @@ -196,7 +196,7 @@ private: F* src = reinterpret_cast(&buffer); F code = std::move(*src); src->~F(); - return code(std::forward(args)...); + return code(std::move(args)...); }, // Destroy: std::is_trivially_destructible::value ? @@ -224,7 +224,7 @@ private: [](TaskUnion& buffer, Args&&... args) { // Delete F when we go out of scope: std::unique_ptr code(*reinterpret_cast(&buffer)); - return (*code)(std::forward(args)...); + return (*code)(std::move(args)...); }, // Destroy: [](TaskUnion& buffer) { @@ -250,7 +250,7 @@ public: throw std::bad_function_call(); const TaskVtable* vtable = vtable_; vtable_ = nullptr; - return vtable->call(buffer_, std::forward(args)...); + return vtable->call(buffer_, std::move(args)...); } };