aboutsummaryrefslogtreecommitdiff
path: root/src/common/scope_exit.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-04-11 20:01:31 -0400
committerLioncash <mathew1800@gmail.com>2019-04-11 20:01:33 -0400
commitb569641098a9cb97f5b7f3d41b7e9ad0377f503f (patch)
tree0bc3dbc20471f4b001a893b7dd24504947899f8a /src/common/scope_exit.h
parent2598433f9ca5b1c03d7ed69d8a71a65c2ea0d40f (diff)
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.
Diffstat (limited to 'src/common/scope_exit.h')
-rw-r--r--src/common/scope_exit.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index baf1f1c9e2..1176a72b19 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -20,7 +20,7 @@ struct ScopeExitHelper {
template <typename Func>
ScopeExitHelper<Func> ScopeExit(Func&& func) {
- return ScopeExitHelper<Func>(std::move(func));
+ return ScopeExitHelper<Func>(std::forward<Func>(func));
}
} // namespace detail