ZXFoundation™ 26h2
Loading...
Searching...
No Matches
lib::scope_guard< Fn > Class Template Referenceexport

RAII scope guard — calls fn on destruction unless dismissed. More...

Public Member Functions

auto active () const noexcept -> bool
 Check if the guard is active.
auto dismiss () noexcept -> void
 Dismiss — disarm the guard (cleanup will NOT run).
auto operator= (const scope_guard &)=delete
auto operator= (scope_guard &&)=delete
auto rearm () noexcept -> void
 Re-arm a dismissed guard.
 scope_guard (const scope_guard &)=delete
 scope_guard (Fn fn) noexcept
 Construct a scope guard with the given cleanup function.
 scope_guard (scope_guard &&other) noexcept
 Move constructor — transfers ownership.
 ~scope_guard () noexcept
 Destructor — executes the cleanup if still active.

Detailed Description

template<typename Fn>
class lib::scope_guard< Fn >

RAII scope guard — calls fn on destruction unless dismissed.

Template Parameters
FnCallable type (typically a lambda).

The documentation for this class was generated from the following file: