template<class T = EF, | template<class T = EF, | ||||
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_exit(scope_exit&& other) : m_exitFunction(std::move(other.m_exitFunction)), | |||||
scope_exit(scope_exit&& other) noexcept(std::is_nothrow_move_constructible<T>::value || std::is_nothrow_copy_constructible<T>::value) | |||||
: m_exitFunction(std::move(other.m_exitFunction)), | |||||
m_execute_on_destruction(other.m_execute_on_destruction) | m_execute_on_destruction(other.m_execute_on_destruction) | ||||
{ | { | ||||
other.release(); | other.release(); | ||||
template<class T = EF, | template<class T = EF, | ||||
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_exit(scope_exit&& other) : m_exitFunction(other.m_exitFunction), | |||||
scope_exit(scope_exit&& other) noexcept(std::is_nothrow_move_constructible<T>::value || std::is_nothrow_copy_constructible<T>::value) | |||||
: m_exitFunction(other.m_exitFunction), | |||||
m_execute_on_destruction(other.m_execute_on_destruction) | m_execute_on_destruction(other.m_execute_on_destruction) | ||||
{ | { | ||||
other.release(); | other.release(); |
template<class T = EF, | template<class T = EF, | ||||
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_fail(scope_fail&& other) : m_exitFunction(std::move(other.m_exitFunction)), | |||||
scope_fail(scope_fail&& other) noexcept(std::is_nothrow_move_constructible<T>::value || std::is_nothrow_copy_constructible<T>::value) | |||||
: m_exitFunction(std::move(other.m_exitFunction)), | |||||
m_execute_on_destruction(other.m_execute_on_destruction), | m_execute_on_destruction(other.m_execute_on_destruction), | ||||
m_uncaught_on_creation(uncaught_exceptions()) | m_uncaught_on_creation(uncaught_exceptions()) | ||||
{ | { | ||||
template<class T = EF, | template<class T = EF, | ||||
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_fail(scope_fail&& other) : m_exitFunction(other.m_exitFunction), | |||||
scope_fail(scope_fail&& other) noexcept(std::is_nothrow_move_constructible<T>::value || std::is_nothrow_copy_constructible<T>::value) | |||||
: m_exitFunction(other.m_exitFunction), | |||||
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) | m_uncaught_on_creation(other.m_uncaught_on_creation) | ||||
{ | { |
template<class T = EF, | template<class T = EF, | ||||
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_exitFunction(std::move(other.m_exitFunction)), | |||||
scope_success(scope_success&& other) noexcept(std::is_nothrow_move_constructible<T>::value || std::is_nothrow_copy_constructible<T>::value) | |||||
: m_exitFunction(std::move(other.m_exitFunction)), | |||||
m_execute_on_destruction(other.m_execute_on_destruction), | m_execute_on_destruction(other.m_execute_on_destruction), | ||||
m_uncaught_on_creation(uncaught_exceptions()) | m_uncaught_on_creation(uncaught_exceptions()) | ||||
{ | { | ||||
template<class T = EF, | template<class T = EF, | ||||
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_exitFunction(other.m_exitFunction), | |||||
scope_success(scope_success&& other) noexcept(std::is_nothrow_move_constructible<T>::value || std::is_nothrow_copy_constructible<T>::value) | |||||
: m_exitFunction(other.m_exitFunction), | |||||
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) | m_uncaught_on_creation(other.m_uncaught_on_creation) | ||||
{ | { |