Selaa lähdekoodia

Refactoring.

main
offa 8 vuotta sitten
vanhempi
commit
f745593342
1 muutettua tiedostoa jossa 2 lisäystä ja 9 poistoa
  1. +2
    -9
      include/unique_resource.h

+ 2
- 9
include/unique_resource.h Näytä tiedosto



~unique_resource_t() ~unique_resource_t()
{ {
if( m_execute_on_destruction == true )
{
try
{
m_deleter(m_resource);
}
catch( ... ) { /* Empty */ }
}
invoke(invoke_it::once);
} }






unique_resource_t& operator=(unique_resource_t&& other) noexcept unique_resource_t& operator=(unique_resource_t&& other) noexcept
{ {
m_deleter(m_resource);
invoke(invoke_it::once);
m_resource = std::move(other.m_resource); m_resource = std::move(other.m_resource);
m_deleter = std::move(other.m_deleter); m_deleter = std::move(other.m_deleter);
m_execute_on_destruction = other.m_execute_on_destruction; m_execute_on_destruction = other.m_execute_on_destruction;

Loading…
Peruuta
Tallenna