libosmscout 0.1
Loading...
Searching...
No Matches
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

ScopeGuard & operator= (const ScopeGuard &)=delete
ScopeGuard & operator= (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";
});
ScopeGuard(CB cb) noexcept(noexcept(std::move(cb)))
Definition ScopeGuard.h:45
Log log
The one and only global instance of the logger that should get used for all logging output.
Definition LoggerImpl.h:95
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

References ScopeGuard().

◆ ScopeGuard() [3/3]

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

References ScopeGuard().

◆ ~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

References ScopeGuard().

◆ operator=() [2/2]

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

References ScopeGuard().


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