Merge 49371c5f298707209c5f947bec747558bcd955a6 into 2828399820ef4928cc89b65605dca5dc68efca6e

This commit is contained in:
apenn-msft 2025-03-03 10:29:27 -06:00 committed by GitHub
commit e8d35f45e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -816,7 +816,7 @@ explicit final_action(F&& ff) noexcept;
Construct an object with the action to invoke in the destructor.
```cpp
~final_action() noexcept;
~final_action() noexcept(std::is_nothrow_invocable_v<F>);
```
The destructor will call the action that was passed in the constructor.

View File

@ -103,7 +103,7 @@ public:
explicit final_action(const F& ff) noexcept : f{ff} { }
explicit final_action(F&& ff) noexcept : f{std::move(ff)} { }
~final_action() noexcept { if (invoke) f(); }
~final_action() noexcept(std::is_nothrow_invocable_v<F>) { if (invoke) f(); }
final_action(final_action&& other) noexcept
: f(std::move(other.f)), invoke(std::exchange(other.invoke, false))