Explorar el Código

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

main
offa hace 6 años
padre
commit
e5a9b9acbf
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. +1
    -1
      include/detail/scope_guard_base.h

+ 1
- 1
include/detail/scope_guard_base.h Ver fichero

@@ -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)
{
}

Cargando…
Cancelar
Guardar