Sleipnir C++ API
Loading...
Searching...
No Matches
slp::scope_exit< F > Class Template Reference

#include <sleipnir/util/scope_exit.hpp>

Public Member Functions

 scope_exit (F &&f) noexcept
 
 scope_exit (scope_exit &&rhs) noexcept
 
 scope_exit (const scope_exit &)=delete
 
scope_exitoperator= (const scope_exit &)=delete
 
void release () noexcept
 

Detailed Description

template<typename F>
class slp::scope_exit< F >

scope_exit is a general-purpose scope guard intended to call its exit function when a scope is exited.

Template Parameters
FFunction type.

Constructor & Destructor Documentation

◆ scope_exit() [1/2]

template<typename F >
slp::scope_exit< F >::scope_exit ( F &&  f)
inlineexplicitnoexcept

Constructs a scope_exit.

Parameters
fFunction to call on scope exit.

◆ scope_exit() [2/2]

template<typename F >
slp::scope_exit< F >::scope_exit ( scope_exit< F > &&  rhs)
inlinenoexcept

Move constructor.

Parameters
rhsscope_exit from which to move.

Member Function Documentation

◆ release()

template<typename F >
void slp::scope_exit< F >::release ( )
inlinenoexcept

Makes the scope_exit inactive.


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