From 6349eaf761d8c7b80db00d48217890c20931964e Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sun, 22 Dec 2019 16:45:41 +0100 Subject: [PATCH] [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. --- include/xbt/functional.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)...); } }; -- 2.20.1