|
|
|
|
|
|
|
|
return m_resource.get(); |
|
|
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 |
|
|
RR operator->() const noexcept |
|
|
{ |
|
|
{ |
|
|
return m_resource.get(); |
|
|
return m_resource.get(); |
|
|
|
|
|
|
|
|
&& std::is_nothrow_constructible_v<std::decay_t<D>, D>) |
|
|
&& std::is_nothrow_constructible_v<std::decay_t<D>, D>) |
|
|
{ |
|
|
{ |
|
|
const bool must_release{r == invalid}; |
|
|
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 ) |
|
|
if( must_release == true ) |
|
|
{ |
|
|
{ |