Commit dc127f39 authored by Max Kellermann's avatar Max Kellermann

util/ScopeExit: use std::declval()

Fixes GCC 10 error: error: cannot call member function `Foo` without object
parent 7a99a700
......@@ -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()();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment