LibrePCB Developers Documentation
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]

ScopeGuard ( )
delete

◆ ScopeGuard() [2/4]

ScopeGuard ( const ScopeGuard< Fun > &  )
delete

◆ ScopeGuard() [3/4]

ScopeGuard ( Fun  f)
inlinenoexcept

◆ ScopeGuard() [4/4]

ScopeGuard ( ScopeGuard< Fun > &&  rhs)
inlinenoexcept

◆ ~ScopeGuard()

~ScopeGuard ( )
inlinenoexcept

Calls the attached cleanup function

Member Function Documentation

◆ operator=()

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

Member Data Documentation

◆ mF

Fun mF
private

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