瀏覽代碼

Forwarding instead of moving is required by R8 (#121).

main
offa 6 年之前
父節點
當前提交
e5a9b9acbf
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      include/detail/scope_guard_base.h

+ 1
- 1
include/detail/scope_guard_base.h 查看文件

@@ -58,7 +58,7 @@ namespace sr::detail
>
explicit scope_guard_base(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP>
|| std::is_nothrow_constructible_v<EF, EFP&>)
: m_exitfunction(std::move(exitFunction)),
: m_exitfunction(std::forward<EFP>(exitFunction)),
m_execute_on_destruction(true)
{
}

Loading…
取消
儲存