libosmscout 1.1.1
Loading...
Searching...
No Matches
osmscout::ScopeGuard< CB > Class Template Reference

#include <libosmscout/include/osmscout/util/ScopeGuard.h>

Public Member Functions

 ScopeGuard (CB cb) noexcept(noexcept(std::move(cb)))
 ScopeGuard (const ScopeGuard &)=delete
 ScopeGuard (ScopeGuard &&other)=delete
ScopeGuardoperator= (const ScopeGuard &)=delete
ScopeGuardoperator= (ScopeGuard &&)=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
OSMSCOUT_API Log log
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

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