Scope guard that invokes a callback on scope exit.
Synopsis
Declared in <absl/cleanup/cleanup.h>
template<
typename Arg,
typename Callback = void()>
class [[nodiscard]] Cleanup final
Description
absl::Cleanup implements the scope guard idiom, invoking the contained callback's operator()() && on scope exit.
This class doesn't allocate or take any locks, and is safe to use in a signal handler. Of course the callback with which it is constructed also must be signal safe in order for this to be useful.
Member Functions
Deduction Guides
Name |
Description |
Deduction guide for creating an |
Non-Member Functions
Name |
Description |
Create an |
Return Value
|
Note
|
The return value should not be discarded. |
Created with MrDocs