Browse Source

Refactoring.

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

+ 2
- 9
include/unique_resource.h View File



~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…
Cancel
Save