Made noexcept-consistent

This commit is contained in:
Herb Sutter 2022-08-30 16:08:07 -07:00 committed by GitHub
parent 6b284bf500
commit 3865bac469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,11 +53,11 @@ class final_action
{
public:
template <class FF>
explicit final_action(FF&& ff) : f{std::forward<FF>(ff)} { }
explicit final_action(FF&& ff) noexcept : f{std::forward<FF>(ff)} { }
~final_action() { if (invoke) f(); }
~final_action() noexcept { if (invoke) f(); }
final_action(final_action&& other)
final_action(final_action&& other) noexcept
: f(std::move(other.f)), invoke(std::exchange(other.invoke, false))
{ }