Browse Source

Factory function updated and SFINAE typo fixed.

main
offa 7 years ago
parent
commit
4aa14a59b8
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      include/unique_resource.h

+ 2
- 2
include/unique_resource.h View File

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

Loading…
Cancel
Save