xrpld
Loading...
Searching...
No Matches
xrpl::ScopeExit< EF > Class Template Reference

#include <scope.h>

Public Member Functions

 ~ScopeExit ()
 ScopeExit (ScopeExit &&rhs) noexcept(std::is_nothrow_move_constructible_v< EF >||std::is_nothrow_copy_constructible_v< EF >)
ScopeExitoperator= (ScopeExit &&)=delete
template<class EFP>
 ScopeExit (EFP &&f, std::enable_if_t< !std::is_same_v< std::remove_cv_t< EFP >, ScopeExit > &&std::is_constructible_v< EF, EFP > > *=0) noexcept
void release () noexcept

Private Attributes

EF exitFunction_
bool executeOnDestruction_ {true}

Detailed Description

template<class EF>
class xrpl::ScopeExit< EF >

Definition at line 25 of file scope.h.

Constructor & Destructor Documentation

◆ ~ScopeExit()

template<class EF>
xrpl::ScopeExit< EF >::~ScopeExit ( )

Definition at line 31 of file scope.h.

◆ ScopeExit() [1/2]

template<class EF>
xrpl::ScopeExit< EF >::ScopeExit ( ScopeExit< EF > && rhs)
noexcept

Definition at line 37 of file scope.h.

◆ ScopeExit() [2/2]

template<class EF>
template<class EFP>
xrpl::ScopeExit< EF >::ScopeExit ( EFP && f,
std::enable_if_t< !std::is_same_v< std::remove_cv_t< EFP >, ScopeExit< EF > > &&std::is_constructible_v< EF, EFP > > * = 0 )
explicitnoexcept

Definition at line 49 of file scope.h.

Member Function Documentation

◆ operator=()

template<class EF>
ScopeExit & xrpl::ScopeExit< EF >::operator= ( ScopeExit< EF > && )
delete

◆ release()

template<class EF>
void xrpl::ScopeExit< EF >::release ( )
noexcept

Definition at line 60 of file scope.h.

Member Data Documentation

◆ exitFunction_

template<class EF>
EF xrpl::ScopeExit< EF >::exitFunction_
private

Definition at line 27 of file scope.h.

◆ executeOnDestruction_

template<class EF>
bool xrpl::ScopeExit< EF >::executeOnDestruction_ {true}
private

Definition at line 28 of file scope.h.