libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
osmscout::ScopeGuard< CB > Class Template Reference

ScopeGuard utility calls its constructor parameter (callable type) in it's destructor (on the end of the scope) More...

#include <ScopeGuard.h>

Public Member Functions

ScopeGuardoperator= (const ScopeGuard &)=delete
 
ScopeGuardoperator= (ScopeGuard &&)=delete
 
 ScopeGuard (CB cb) noexcept(noexcept(std::move(cb)))
 
 ScopeGuard (const ScopeGuard &)=delete
 
 ScopeGuard (ScopeGuard &&other)=delete
 
 ~ScopeGuard () noexcept
 

Detailed Description

template<typename CB>
class osmscout::ScopeGuard< CB >

ScopeGuard utility calls its constructor parameter (callable type) in it's destructor (on the end of the scope)

Examples:

ScopeGuard guard([]() noexcept {
log.Debug() << "End of scope";
});
Template Parameters
CBnoexcept callable.

Constructor & Destructor Documentation

◆ ScopeGuard() [1/3]

template<typename CB >
osmscout::ScopeGuard< CB >::ScopeGuard ( CB  cb)
inlineexplicitnoexcept

◆ ScopeGuard() [2/3]

template<typename CB >
osmscout::ScopeGuard< CB >::ScopeGuard ( const ScopeGuard< CB > &  )
delete

◆ ScopeGuard() [3/3]

template<typename CB >
osmscout::ScopeGuard< CB >::ScopeGuard ( ScopeGuard< CB > &&  other)
delete

◆ ~ScopeGuard()

template<typename CB >
osmscout::ScopeGuard< CB >::~ScopeGuard ( )
inlinenoexcept

Member Function Documentation

◆ operator=() [1/2]

template<typename CB >
ScopeGuard& osmscout::ScopeGuard< CB >::operator= ( const ScopeGuard< CB > &  )
delete

◆ operator=() [2/2]

template<typename CB >
ScopeGuard& osmscout::ScopeGuard< CB >::operator= ( ScopeGuard< CB > &&  )
delete

The documentation for this class was generated from the following file:
osmscout::ScopeGuard::ScopeGuard
ScopeGuard(CB cb) noexcept(noexcept(std::move(cb)))
Definition: ScopeGuard.h:45
osmscout::Log::Debug
Log & Debug(bool state)
Definition: Logger.h:373
osmscout::log
Log log
Definition: LoggerImpl.h:95