std::enable_if_t<(!std::is_lvalue_reference_v<EFP>) | std::enable_if_t<(!std::is_lvalue_reference_v<EFP>) | ||||
&& std::is_nothrow_constructible_v<EF, EFP>, int> = 0 | && std::is_nothrow_constructible_v<EF, EFP>, int> = 0 | ||||
> | > | ||||
explicit scope_guard_base(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP>) | |||||
explicit scope_guard_base(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP> | |||||
|| std::is_nothrow_constructible_v<EF, EFP&>) | |||||
: m_exitfunction(std::move(exitFunction)), | : m_exitfunction(std::move(exitFunction)), | ||||
m_execute_on_destruction(true) | m_execute_on_destruction(true) | ||||
{ | { |
std::enable_if_t<std::is_constructible_v<EF, EFP>, int> = 0, | std::enable_if_t<std::is_constructible_v<EF, EFP>, int> = 0, | ||||
std::enable_if_t<!std::is_same_v<detail::remove_cvref_t<EFP>, scope_exit<EF>>, int> = 0 | std::enable_if_t<!std::is_same_v<detail::remove_cvref_t<EFP>, scope_exit<EF>>, int> = 0 | ||||
> | > | ||||
explicit scope_exit(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP>) | |||||
explicit scope_exit(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP> | |||||
|| std::is_nothrow_constructible_v<EF, EFP&>) | |||||
: Base(std::forward<EFP>(exitFunction)) | : Base(std::forward<EFP>(exitFunction)) | ||||
{ | { | ||||
} | } |
std::enable_if_t<std::is_constructible_v<EF, EFP>, int> = 0, | std::enable_if_t<std::is_constructible_v<EF, EFP>, int> = 0, | ||||
std::enable_if_t<!std::is_same_v<detail::remove_cvref_t<EFP>, scope_fail<EF>>, int> = 0 | std::enable_if_t<!std::is_same_v<detail::remove_cvref_t<EFP>, scope_fail<EF>>, int> = 0 | ||||
> | > | ||||
explicit scope_fail(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP>) | |||||
explicit scope_fail(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP> | |||||
|| std::is_nothrow_constructible_v<EF, EFP&>) | |||||
: Base(std::forward<EFP>(exitFunction)) | : Base(std::forward<EFP>(exitFunction)) | ||||
{ | { | ||||
} | } |
std::enable_if_t<std::is_constructible_v<EF, EFP>, int> = 0, | std::enable_if_t<std::is_constructible_v<EF, EFP>, int> = 0, | ||||
std::enable_if_t<!std::is_same_v<detail::remove_cvref_t<EFP>, scope_success<EF>>, int> = 0 | std::enable_if_t<!std::is_same_v<detail::remove_cvref_t<EFP>, scope_success<EF>>, int> = 0 | ||||
> | > | ||||
explicit scope_success(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP>) | |||||
explicit scope_success(EFP&& exitFunction) noexcept(std::is_nothrow_constructible_v<EF, EFP> | |||||
|| std::is_nothrow_constructible_v<EF, EFP&>) | |||||
: Base(std::forward<EFP>(exitFunction)) | : Base(std::forward<EFP>(exitFunction)) | ||||
{ | { | ||||
} | } |