wip: optimize

This commit is contained in:
2025-12-01 00:31:51 +01:00
parent 149dc3ba49
commit a633a9b04c
8 changed files with 412 additions and 188 deletions
+22
View File
@@ -0,0 +1,22 @@
#ifndef UTILS_H
#define UTILS_H
#include <utility>
template <typename Callable>
class Defer {
Callable m_func;
public:
explicit Defer(Callable&& func)
: m_func(std::forward<Callable>(func)) {}
Defer() = delete;
Defer(const Defer&) = delete;
~Defer() {
m_func();
}
};
#endif // UTILS_H