MostlyHarmless
0.0.1
Loading...
Searching...
No Matches
mostlyharmless_OnScopeExit.h
Go to the documentation of this file.
1
//
2
// Created by Syl on 08/02/2025.
3
//
4
5
#ifndef MOSTLYHARMLESS_MOSTLYHARMLESS_ONSCOPEEXIT_H
6
#define MOSTLYHARMLESS_MOSTLYHARMLESS_ONSCOPEEXIT_H
7
#include <functional>
8
namespace
mostly_harmless::utils
{
25
class
OnScopeExit
final {
26
public
:
31
explicit
OnScopeExit
(std::function<
void
(
void
)>&& action);
32
36
~OnScopeExit
() noexcept;
37
private:
38
std::function<
void
(
void
)> m_action{
nullptr
};
39
};
40
}
41
#endif
// MOSTLYHARMLESS_MOSTLYHARMLESS_ONSCOPEEXIT_H
mostly_harmless::utils::OnScopeExit::~OnScopeExit
~OnScopeExit() noexcept
mostly_harmless::utils::OnScopeExit::OnScopeExit
OnScopeExit(std::function< void(void)> &&action)
mostly_harmless::utils
Contains general purpose utility classes & functions.
Definition
mostlyharmless_TaskThread.h:12
include
mostly_harmless
utils
mostlyharmless_OnScopeExit.h
Generated by
1.13.2