diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-30 12:53:26 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-30 12:53:26 +0200 |
commit | c3459749ce67e04757dac1f8e91af8203bacbe8f (patch) | |
tree | f7f04af56d72a4b47a6c7de2e277da0aff318030 /compat/util.hpp | |
parent | ab48cb1a088726130e814cbddc568c399fb5dc10 (diff) |
compat/util: add macro for warning once
Diffstat (limited to 'compat/util.hpp')
-rw-r--r-- | compat/util.hpp | 3 |
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>; |