Sfoglia il codice sorgente

Refactoring, both mctor's can be merged into one.

main
offa 7 anni fa
parent
commit
b9cce110e6
1 ha cambiato i file con 0 aggiunte e 16 eliminazioni
  1. +0
    -16
      include/unique_resource.h

+ 0
- 16
include/unique_resource.h Vedi File

@@ -101,10 +101,6 @@ namespace sr
d(r);
}

template<class TR = R, class TD = D,
std::enable_if_t<(std::is_nothrow_move_constructible<TR>::value
&& std::is_nothrow_move_constructible<TD>::value), int> = 0
>
unique_resource(unique_resource&& other) noexcept(std::is_nothrow_move_constructible<R>::value
&& std::is_nothrow_move_constructible<D>::value)
: m_resource(forward_if_nothrow_move_constructible<R>(std::forward<R>(other.m_resource))),
@@ -113,18 +109,6 @@ namespace sr
{
}

template<class TR = R, class TD = D,
std::enable_if_t<(!std::is_nothrow_move_constructible<TR>::value
|| !std::is_nothrow_move_constructible<TD>::value), int> = 0
>
unique_resource(unique_resource&& other) noexcept(std::is_nothrow_move_constructible<R>::value
&& std::is_nothrow_move_constructible<D>::value)
: m_resource(other.m_resource),
m_deleter(other.m_deleter),
m_execute_on_destruction(std::exchange(other.m_execute_on_destruction, false))
{
}

unique_resource(const unique_resource&) = delete;

~unique_resource()

Loading…
Annulla
Salva