util/ScopeExit: use std::declval()
Fixes GCC 10 error: error: cannot call member function `Foo` without object
This commit is contained in:
parent
7a99a7008c
commit
dc127f39a7
|
@ -50,7 +50,7 @@ public:
|
|||
"noexcept" declaration allows the destructor to throw if
|
||||
the function can throw; without this, a throwing function
|
||||
would std::terminate() */
|
||||
~ScopeExitGuard() noexcept(noexcept(F::operator()())) {
|
||||
~ScopeExitGuard() noexcept(noexcept(std::declval<F>()())) {
|
||||
if (enabled)
|
||||
F::operator()();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue