瀏覽代碼

MCtor implementation updated.

main
offa 7 年之前
父節點
當前提交
6a02c8a311
共有 1 個檔案被更改,包括 9 行新增1 行删除
  1. +9
    -1
      include/unique_resource.h

+ 9
- 1
include/unique_resource.h 查看文件

@@ -150,7 +150,15 @@ namespace sr
{
}

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;

Loading…
取消
儲存