소스 검색

Merge pull request #2391 from lioncash/scope

common/scope_exit: Replace std::move with std::forward in ScopeExit()
bunnei 7 년 전
부모
커밋
b42595fa6b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/common/scope_exit.h

+ 1 - 1
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