Added two new commands

This commit is contained in:
WolverinDEV 2019-09-14 14:22:15 +02:00
parent 316afd9f56
commit 4a9d8f132f

13
src/misc/scope_guard.h Normal file
View File

@ -0,0 +1,13 @@
#pragma once
template <typename callback_t>
struct scope_exit_callback {
public:
scope_exit_callback(callback_t&& callback) : callback(std::forward<callback_t>(callback)) {}
~scope_exit_callback() {
this->callback();
}
private:
callback_t callback;
};