From 14a8110d1f73628a0aa8a268a2d351caf1746399 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Tue, 23 Jun 2015 12:02:23 +0200 Subject: [PATCH] future: Avoid copying of the result in get0() Even though we accept std::tuple&&, 'x' is an l-value reference inside get0(). --- core/future.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/future.hh b/core/future.hh index 4b404d0b18..d5dbb8a0a6 100644 --- a/core/future.hh +++ b/core/future.hh @@ -227,7 +227,7 @@ struct future_state { } using get0_return_type = std::tuple_element_t<0, std::tuple>; static get0_return_type get0(std::tuple&& x) { - return std::get<0>(x); + return std::get<0>(std::move(x)); } void forward_to(promise& pr) noexcept { assert(_state != state::future);