Squid::Tasks 1.0.0
C++14 coroutine-based task library for games
FunctionGuard< tFn > Class Template Reference

Public Member Functions

 FunctionGuard (nullptr_t)
 Default constructor. More...
 
 FunctionGuard (tFn in_fn)
 Functor constructor.
 
 ~FunctionGuard ()
 Destructor.
 
 FunctionGuard (FunctionGuard &&in_other) noexcept
 Move constructor.
 
FunctionGuardoperator= (FunctionGuard< tFn > &&in_other) noexcept
 Move assignment operator.
 
FunctionGuardoperator= (nullptr_t) noexcept
 Null-pointer assignment operator (calls Forget() to clear the functor)
 
 operator bool () const
 Convenience conversion operator that calls IsBound()
 
bool IsBound () noexcept
 Returns whether functor has been bound to this FunctionGuard.
 
void Execute ()
 Executes and clears the functor (if bound)
 
void Forget () noexcept
 Clear the functor (without calling it)
 

Constructor & Destructor Documentation

◆ FunctionGuard()

template<typename tFn = std::function<void()>>
FunctionGuard< tFn >::FunctionGuard ( nullptr_t  )
inline

Default constructor.

Null-pointer constructor


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