LibrePCB Developers Documentation
Loading...
Searching...
No Matches
ScopeGuard< Fun > Class Template Referencefinal

#include <scopeguard.h>

+ Inheritance diagram for ScopeGuard< Fun >:
+ Collaboration diagram for ScopeGuard< Fun >:

Public Member Functions

 ScopeGuard ()=delete
 
 ScopeGuard (const ScopeGuard &)=delete
 
 ScopeGuard (Fun f) noexcept
 
 ScopeGuard (ScopeGuard &&rhs) noexcept
 
 ~ScopeGuard () noexcept
 
ScopeGuardoperator= (const ScopeGuard &)=delete
 
- Public Member Functions inherited from ScopeGuardBase
 ScopeGuardBase () noexcept
 
 ScopeGuardBase (ScopeGuardBase &&rhs) noexcept
 
void dismiss () noexcept
 

Private Attributes

Fun mF
 

Additional Inherited Members

- Protected Member Functions inherited from ScopeGuardBase
 ~ScopeGuardBase ()=default
 
- Protected Attributes inherited from ScopeGuardBase
bool mActive
 

Detailed Description

template<class Fun>
class librepcb::ScopeGuard< Fun >

Implementation of a ScopeGuard based on https://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C

Constructor & Destructor Documentation

◆ ScopeGuard() [1/4]

template<class Fun >
ScopeGuard ( )
delete

◆ ScopeGuard() [2/4]

template<class Fun >
ScopeGuard ( const ScopeGuard< Fun > &  )
delete

◆ ScopeGuard() [3/4]

template<class Fun >
ScopeGuard ( Fun  f)
inlinenoexcept

◆ ScopeGuard() [4/4]

template<class Fun >
ScopeGuard ( ScopeGuard< Fun > &&  rhs)
inlinenoexcept

◆ ~ScopeGuard()

template<class Fun >
~ScopeGuard ( )
inlinenoexcept

Calls the attached cleanup function

Member Function Documentation

◆ operator=()

template<class Fun >
ScopeGuard & operator= ( const ScopeGuard< Fun > &  )
delete

Member Data Documentation

◆ mF

template<class Fun >
Fun mF
private

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