RAII scope guard — executes a cleanup callback on scope exit. More...
Data Structures | |
| class | lib::scope_guard< Fn > |
RAII scope guard — calls fn on destruction unless dismissed. More... | |
Functions | |
| template<typename Fn> | |
| auto | lib::make_scope_guard (Fn &&fn) noexcept -> scope_guard< Fn > |
| Factory function — deduces Fn from the argument. | |
RAII scope guard — executes a cleanup callback on scope exit.
SPDX-License-Identifier: Apache-2.0
|
nodiscardexportnoexcept |
Factory function — deduces Fn from the argument.
Usage: auto guard = lib::make_scope_guard([&]{ cleanup(); });