System::ScopeGuard< F > Struct Template Reference

Public Member Functions

 ScopeGuard (F f)
 ~ScopeGuard () noexcept(false)
 Invokes the function object passed to the constructor. More...

Detailed Description

template<typename F>
struct System::ScopeGuard< F >

The service class that provides services for running a particular function object when an instance of the class goes out of scope.

Template Parameters
FThe type of the function object invoked by the instances of the ScopedGuard class

Constructor & Destructor Documentation

◆ ScopeGuard()

template<typename F >
System::ScopeGuard< F >::ScopeGuard ( f)

Constructs an instance that is set up to invoke the specified function object.

fThe function object to be invoked in the destructor of the object being constructed.

◆ ~ScopeGuard()

template<typename F >
System::ScopeGuard< F >::~ScopeGuard ( )

Invokes the function object passed to the constructor.