FinallyOnce< T > Class Template Reference

#include <finally.h>

Public Member Functions

MAXON_IMPLICIT FinallyOnce (FinallyOnce &&src)
 
MAXON_IMPLICIT FinallyOnce (T &&lambda)
 
 ~FinallyOnce ()
 
 MAXON_OPERATOR_MOVE_ASSIGNMENT (FinallyOnce)
 
void Disable ()
 
void Enable ()
 
std::invoke_result< T >::type operator() ()
 

Private Member Functions

 MAXON_DISALLOW_COPY_AND_ASSIGN (FinallyOnce)
 

Private Attributes

_lambda
 
Bool _isEnabled
 

Constructor & Destructor Documentation

◆ FinallyOnce() [1/2]

◆ FinallyOnce() [2/2]

MAXON_IMPLICIT FinallyOnce ( T &&  lambda)

◆ ~FinallyOnce()

Member Function Documentation

◆ MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( FinallyOnce< T >  )
private

◆ MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( FinallyOnce< T >  )

◆ Disable()

void Disable ( )

Disables the invocation of the lambda.

◆ Enable()

void Enable ( )

Enables the invocation of the lambda.

◆ operator()()

std::invoke_result<T>::type operator() ( )

Member Data Documentation

◆ _lambda

T _lambda
private

◆ _isEnabled

Bool _isEnabled
private