summaryrefslogtreecommitdiffhomepage
path: root/compat/util.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'compat/util.hpp')
-rw-r--r--compat/util.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/compat/util.hpp b/compat/util.hpp
index 9439271f..ee462d0e 100644
--- a/compat/util.hpp
+++ b/compat/util.hpp
@@ -11,6 +11,9 @@
#include <QDebug>
#define progn(...) ([&]() { __VA_ARGS__ }())
+
+#define once_only(...) progn(static bool once = false; if (!once) { once = true; __VA_ARGS__; })
+
template<typename t> using mem = std::shared_ptr<t>;
template<typename t> using ptr = std::unique_ptr<t>;