瀏覽代碼

Member renamed.

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

+ 6
- 6
include/scope_fail.h 查看文件

@@ -37,7 +37,7 @@ namespace sr
std::enable_if_t<(!std::is_lvalue_reference<EFP>::value)
&& std::is_nothrow_constructible<EF, EFP>::value, int> = 0
>
explicit scope_fail(EFP&& deleter) : m_deleter(std::move(deleter)),
explicit scope_fail(EFP&& deleter) : m_exitFunction(std::move(deleter)),
m_execute_on_destruction(true),
m_uncaught_on_creation(uncaught_exceptions())
{
@@ -47,7 +47,7 @@ namespace sr
std::enable_if_t<std::is_constructible<EF, EFP>::value, int> = 0,
std::enable_if_t<std::is_lvalue_reference<EFP>::value, int> = 0
>
explicit scope_fail(EFP&& deleter) try : m_deleter(deleter),
explicit scope_fail(EFP&& deleter) try : m_exitFunction(deleter),
m_execute_on_destruction(true),
m_uncaught_on_creation(uncaught_exceptions())
{
@@ -63,7 +63,7 @@ namespace sr
template<class T = EF,
std::enable_if_t<std::is_nothrow_move_constructible<T>::value, int> = 0
>
scope_fail(scope_fail&& other) : m_deleter(std::move(other.m_deleter)),
scope_fail(scope_fail&& other) : m_exitFunction(std::move(other.m_exitFunction)),
m_execute_on_destruction(other.m_execute_on_destruction),
m_uncaught_on_creation(uncaught_exceptions())
{
@@ -73,7 +73,7 @@ namespace sr
template<class T = EF,
std::enable_if_t<!std::is_nothrow_move_constructible<T>::value, int> = 0
>
scope_fail(scope_fail&& other) : m_deleter(other.m_deleter),
scope_fail(scope_fail&& other) : m_exitFunction(other.m_exitFunction),
m_execute_on_destruction(other.m_execute_on_destruction),
m_uncaught_on_creation(other.m_uncaught_on_creation)
{
@@ -84,7 +84,7 @@ namespace sr
{
if( (m_execute_on_destruction == true) && ( uncaught_exceptions() > m_uncaught_on_creation ) )
{
m_deleter();
m_exitFunction();
}
}

@@ -106,7 +106,7 @@ namespace sr
return ( std::uncaught_exception() == true ? 1 : 0 );
}

EF m_deleter;
EF m_exitFunction;
bool m_execute_on_destruction;
int m_uncaught_on_creation;
};

Loading…
取消
儲存