From 844c6f74ce8e8832ded7f9c56b25008d951949ab Mon Sep 17 00:00:00 2001 From: Markus Pfeiffer Date: Thu, 30 May 2019 14:51:57 +0100 Subject: [PATCH] Remove std::move as it prevents copy elision (#9144) --- lib/Futures/Future.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Futures/Future.h b/lib/Futures/Future.h index 06e92db1af..b40861c801 100644 --- a/lib/Futures/Future.h +++ b/lib/Futures/Future.h @@ -326,7 +326,7 @@ class Future { })); } }); - return std::move(future); + return future; } /// Variant: callable accepts T&&, returns future @@ -358,7 +358,7 @@ class Future { } } }); - return std::move(future); + return future; } /// Variant: callable accepts Try, returns value @@ -380,7 +380,7 @@ class Future { return futures::invoke(std::forward(fn), std::move(t)); })); }); - return std::move(future); + return future; } /// Variant: callable accepts Try, returns future @@ -404,7 +404,7 @@ class Future { pr.setException(std::current_exception()); } }); - return std::move(future); + return future; } /// Variant: function returns void and accepts Try&& @@ -442,7 +442,7 @@ class Future { pr.setTry(std::move(t)); } }); - return std::move(future); + return future; } /// Set an error continuation for this Future where the continuation can @@ -476,7 +476,7 @@ class Future { pr.setTry(std::move(t)); } }); - return std::move(future); + return future; } private: