Cppgres
Build Postgres extensions in C++
Loading...
Searching...
No Matches
cppgres::scope_exit< Func > Struct Template Reference

Scope guard that always runs the callable on scope exit. More...

#include <guard.hpp>

Public Member Functions

 scope_exit (Func f, const char *warning_message)
 
 scope_exit (const scope_exit &)=delete
 
scope_exitoperator= (const scope_exit &)=delete
 
 scope_exit (scope_exit &&)=delete
 
scope_exitoperator= (scope_exit &&)=delete
 

Public Attributes

Func func
 
const char * warning_message
 

Detailed Description

template<typename Func>
struct cppgres::scope_exit< Func >

Scope guard that always runs the callable on scope exit.

Unlike cppgres::scope_fail, the destructor runs the callable unconditionally — on normal exit and during unwinding alike — through cppgres::ffi_guard_noexcept, so the cleanup itself never throws, degrading any failure to a WARNING with the given message.


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