Bladeren bron

Typetrait added instead of templated variable.

main
offa 7 jaren geleden
bovenliggende
commit
5d396b25ef
2 gewijzigde bestanden met toevoegingen van 9 en 3 verwijderingen
  1. +5
    -2
      include/detail/scope_guard_base.h
  2. +4
    -1
      include/scope_fail.h

+ 5
- 2
include/detail/scope_guard_base.h Bestand weergeven

@@ -29,7 +29,10 @@ namespace detail
{

template<class F, class S>
constexpr bool is_noexcept_dtor_v = true;
struct is_noexcept_dtor
{
static constexpr bool value = true;
};


template<class EF, class Strategy>
@@ -88,7 +91,7 @@ namespace detail
scope_guard_base(const scope_guard_base&) = delete;


~scope_guard_base() noexcept(is_noexcept_dtor_v<EF, Strategy>)
~scope_guard_base() noexcept(is_noexcept_dtor<EF, Strategy>::value)
{
if( (m_execute_on_destruction == true) && (this->should_execute() == true) )
{

+ 4
- 1
include/scope_fail.h Bestand weergeven

@@ -47,7 +47,10 @@ namespace sr


template<class F>
constexpr bool is_noexcept_dtor_v<F, scope_fail_strategy> = noexcept(std::declval<F>()());
struct is_noexcept_dtor<F, scope_fail_strategy>
{
static constexpr bool value = noexcept(std::declval<F>()());
};

}


Laden…
Annuleren
Opslaan