header_utils
|
A RAII class that executes a function on destruction, if its request counter is greater than zero. More...
#include <scope.h>
Public Member Functions | |
template<class EFP > | |
counted_scope_guard (EFP &&f, int initial_count=0) noexcept(noexcept(EFP(std::forward< EFP >(f)))) | |
counted_scope_guard (counted_scope_guard &&rhs) noexcept(noexcept(EF(std::move(rhs.m_exit_function)))) | |
counted_scope_guard (const counted_scope_guard &)=delete | |
counted_scope_guard & | operator= (const counted_scope_guard &)=delete |
counted_scope_guard & | operator= (counted_scope_guard &&)=delete |
~counted_scope_guard () noexcept(noexcept(m_exit_function())) | |
Executes the function on destruction if the request counter is greater than zero. | |
void | request () noexcept |
Increments the request counter. | |
void | unrequest () noexcept |
Decrements the request counter. | |
void | release () noexcept |
Releases the guard, so that it will not execute the function on destruction. | |
bool | will_execute_on_destruction () const noexcept |
A RAII class that executes a function on destruction, if its request counter is greater than zero.
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |