Explorar el Código

Factory function updated and SFINAE typo fixed.

main
offa hace 7 años
padre
commit
4aa14a59b8
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. +2
    -2
      include/unique_resource.h

+ 2
- 2
include/unique_resource.h Ver fichero

@@ -117,7 +117,7 @@ namespace sr
return m_resource.get();
}

template<class RR = R, std::enable_if_t<std::is_pointer_v<RR>>
template<class RR = R, std::enable_if_t<std::is_pointer_v<RR>, int> = 0>
RR operator->() const noexcept
{
return m_resource.get();
@@ -192,7 +192,7 @@ namespace sr
&& std::is_nothrow_constructible_v<std::decay_t<D>, D>)
{
const bool must_release{r == invalid};
auto ur = unique_resource{r, d};
unique_resource<std::decay_t<R>, std::decay_t<D>> ur{std::forward<R>(r), std::forward<D>(d)};

if( must_release == true )
{

Cargando…
Cancelar
Guardar