header_utils
Loading...
Searching...
No Matches
ghassanpl::scope_guard< EF > Struct Template Reference

A RAII class that executes a function on destruction. More...

#include <scope.h>

Public Member Functions

template<class EFP >
 scope_guard (EFP &&f) noexcept(noexcept(EFP(std::forward< EFP >(f))))
 
 scope_guard (scope_guard &&rhs) noexcept(noexcept(EF(std::move(rhs.exit_function))))
 
 scope_guard (const scope_guard &)=delete
 
scope_guardoperator= (const scope_guard &)=delete
 
scope_guardoperator= (scope_guard &&)=delete
 
void release () noexcept
 
bool will_execute_on_destruction () const noexcept
 

Detailed Description

template<class EF>
struct ghassanpl::scope_guard< EF >

A RAII class that executes a function on destruction.

Definition at line 14 of file scope.h.

Constructor & Destructor Documentation

◆ scope_guard() [1/2]

template<class EF >
template<class EFP >
ghassanpl::scope_guard< EF >::scope_guard ( EFP &&  f)
inlineexplicitnoexcept

Definition at line 17 of file scope.h.

◆ scope_guard() [2/2]

template<class EF >
ghassanpl::scope_guard< EF >::scope_guard ( scope_guard< EF > &&  rhs)
inlinenoexcept

Definition at line 22 of file scope.h.

◆ ~scope_guard()

template<class EF >
ghassanpl::scope_guard< EF >::~scope_guard ( )
inlinenoexcept

Definition at line 32 of file scope.h.

Member Function Documentation

◆ release()

template<class EF >
void ghassanpl::scope_guard< EF >::release ( )
inlinenoexcept

Definition at line 38 of file scope.h.

◆ will_execute_on_destruction()

template<class EF >
bool ghassanpl::scope_guard< EF >::will_execute_on_destruction ( ) const
inlinenoexcept

Definition at line 43 of file scope.h.