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

@@ -54,14 +54,7 @@ namespace sr

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


@@ -87,7 +80,7 @@ namespace sr

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_deleter = std::move(other.m_deleter);
m_execute_on_destruction = other.m_execute_on_destruction;

Loading…
Cancel
Save