|
halcheck 1.0
|
Calls a function upon destruction. More...
#include <scope.hpp>
Public Member Functions | |
| constexpr | finally_t ()=default |
| A default-constructed finally_t does nothing upon scope exit. | |
| constexpr | finally_t (F func) noexcept(std::is_nothrow_move_constructible< F >()) |
| Construct an object that calls the given function upon destruction. | |
| finally_t (finally_t &&other) noexcept(std::is_nothrow_move_constructible< F >()) | |
| Delays the invocation of a finally_t's underlying function by transfering the responsibility of calling the function to a new finally_t. | |
| template<typename G > | |
| finally_t (finally_t< G > &&other) noexcept(std::is_constructible< F, G >()) | |
| Delays the invocation of a finally_t's underlying function by transfering the responsibility of calling the function to a new finally_t. | |
| template<typename G > | |
| finally_t (finally_t< G > &&other) noexcept(std::is_constructible< F, G >()) | |
| Delays the invocation of a finally_t's underlying function by transfering the responsibility of calling the function to a new finally_t. | |
| finally_t (const finally_t &)=delete | |
| finally_t & | operator= (const finally_t &)=delete |
| finally_t & | operator= (finally_t &&)=delete |
| void * | operator new (std::size_t)=delete |
| void * | operator new[] (std::size_t)=delete |
| ~finally_t () noexcept | |
| Invokes the underlying function. | |
Friends | |
| template<typename G > | |
| finally_t< combine< G > > | operator+ (finally_t &&lhs, finally_t< G > &&rhs) |
| Combines two finally_t values into one, such that both underlying functions are called upon destruction of the return value. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename F > | |
| lib::finally_t< F > | finally (F func) |
Calls a function upon destruction.
| F | The type of function to call upon destruction. |