浏览代码

Missing field initialization of uncaught exceptions added.

main
offa 8 年前
父节点
当前提交
8b02efb655
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. +6
    -3
      include/scope_success.h

+ 6
- 3
include/scope_success.h 查看文件

&& std::is_nothrow_constructible<Deleter, D>::value, int> = 0 && std::is_nothrow_constructible<Deleter, D>::value, int> = 0
> >
explicit scope_success(D&& deleter) : m_deleter(std::move(deleter)), explicit scope_success(D&& deleter) : m_deleter(std::move(deleter)),
m_execute_on_destruction(true)
m_execute_on_destruction(true),
m_uncaught_on_creation(uncaught_exceptions())
{ {
} }


std::enable_if_t<std::is_lvalue_reference<D>::value, int> = 0 std::enable_if_t<std::is_lvalue_reference<D>::value, int> = 0
> >
explicit scope_success(D&& deleter) try : m_deleter(deleter), explicit scope_success(D&& deleter) try : m_deleter(deleter),
m_execute_on_destruction(true)
m_execute_on_destruction(true),
m_uncaught_on_creation(uncaught_exceptions())
{ {
} }
catch( ... ) catch( ... )
std::enable_if_t<!std::is_nothrow_move_constructible<T>::value, int> = 0 std::enable_if_t<!std::is_nothrow_move_constructible<T>::value, int> = 0
> >
scope_success(scope_success&& other) : m_deleter(other.m_deleter), scope_success(scope_success&& other) : m_deleter(other.m_deleter),
m_execute_on_destruction(other.m_execute_on_destruction)
m_execute_on_destruction(other.m_execute_on_destruction),
m_uncaught_on_creation(other.m_uncaught_on_creation)
{ {
other.release(); other.release();
} }

正在加载...
取消
保存