TeaSpeakLibrary/src/misc/scope_guard.h
2019-09-14 14:22:15 +02:00

13 lines
266 B
C++

#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;
};