From b569641098a9cb97f5b7f3d41b7e9ad0377f503f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 11 Apr 2019 20:01:31 -0400 Subject: common/scope_exit: Replace std::move with std::forward in ScopeExit() The template type here is actually a forwarding reference, not an rvalue reference in this case, so it's more appropriate to use std::forward to preserve the value category of the type being moved. --- src/common/scope_exit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/scope_exit.h') diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h index baf1f1c9e..1176a72b1 100644 --- a/src/common/scope_exit.h +++ b/src/common/scope_exit.h @@ -20,7 +20,7 @@ struct ScopeExitHelper { template ScopeExitHelper ScopeExit(Func&& func) { - return ScopeExitHelper(std::move(func)); + return ScopeExitHelper(std::forward(func)); } } // namespace detail -- cgit v1.2.3