瀏覽代碼

Explicit removed from the unique_resource ctor (#140).

main
offa 6 年之前
父節點
當前提交
fcf67440ed
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. +5
    -5
      include/unique_resource.h

+ 5
- 5
include/unique_resource.h 查看文件

@@ -51,11 +51,11 @@ namespace sr
&& (std::is_nothrow_constructible_v<R, RR> || std::is_constructible_v<R, RR&>)
&& (std::is_nothrow_constructible_v<D, DD> || std::is_constructible_v<D, DD&>)), int> = 0
>
explicit unique_resource(RR&& r, DD&& d) noexcept((std::is_nothrow_constructible_v<R, RR> || std::is_nothrow_constructible_v<R, RR&>)
&& (std::is_nothrow_constructible_v<D, DD> || std::is_nothrow_constructible_v<D, DD&>))
: resource(detail::forward_if_nothrow_constructible<R, RR>(std::forward<RR>(r)), scope_exit{[&r, &d] { d(r); }}),
deleter(detail::forward_if_nothrow_constructible<D, DD>(std::forward<DD>(d)), scope_exit{[this, &d] { d(get()); }}),
execute_on_reset(true)
unique_resource(RR&& r, DD&& d) noexcept((std::is_nothrow_constructible_v<R, RR> || std::is_nothrow_constructible_v<R, RR&>)
&& (std::is_nothrow_constructible_v<D, DD> || std::is_nothrow_constructible_v<D, DD&>))
: resource(detail::forward_if_nothrow_constructible<R, RR>(std::forward<RR>(r)), scope_exit{[&r, &d] { d(r); }}),
deleter(detail::forward_if_nothrow_constructible<D, DD>(std::forward<DD>(d)), scope_exit{[this, &d] { d(get()); }}),
execute_on_reset(true)
{
}


Loading…
取消
儲存