mirror of
https://github.com/microsoft/GSL.git
synced 2025-04-22 09:15:30 -04:00
Compare commits
5 Commits
e8d35f45e7
...
7ee701d3d1
Author | SHA1 | Date | |
---|---|---|---|
|
7ee701d3d1 | ||
|
49371c5f29 | ||
|
e00c1ccf55 | ||
|
628b2c5c27 | ||
|
8ffd43043d |
@ -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.
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user