aboutsummaryrefslogtreecommitdiff
path: root/src/utils.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/utils.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils.hpp b/src/utils.hpp
index d5d4fc5..d7ca4c0 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include <memory>
+
#define DELEGATE(OBJ, METHOD, METHOD_AS) \
template <typename... Args> decltype(auto) METHOD_AS(Args &&...args) { \
return OBJ->METHOD(std::forward<Args>(args)...); \
@@ -10,3 +12,6 @@
#define DEFINE_GETTER(METHOD, EXPR) \
decltype(auto) METHOD() { return EXPR; }
+
+#define DEFER(DEFERRED_BLOCK) \
+ std::shared_ptr<void> __deferred(nullptr, [](...) DEFERRED_BLOCK);