Browse Source

MCtor implementation updated.

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

+ 9
- 1
include/unique_resource.h View File

{ {
} }


unique_resource(unique_resource&&) = default;
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(other.m_resource.get()), make_scope_exit([] { })),
m_deleter(forward_if_nothrow_move_constructible(other.m_deleter.get()), make_scope_exit([&other] {
other.get_deleter()(other.m_resource.get());
other.release(); })),
m_execute_on_destruction(std::exchange(other.m_execute_on_destruction, false))
{
}




unique_resource(const unique_resource&) = delete; unique_resource(const unique_resource&) = delete;

Loading…
Cancel
Save