From c3459749ce67e04757dac1f8e91af8203bacbe8f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 30 Mar 2017 12:53:26 +0200 Subject: compat/util: add macro for warning once --- compat/util.hpp | 3 +++ 1 file changed, 3 insertions(+) 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 #define progn(...) ([&]() { __VA_ARGS__ }()) + +#define once_only(...) progn(static bool once = false; if (!once) { once = true; __VA_ARGS__; }) + template using mem = std::shared_ptr; template using ptr = std::unique_ptr; -- cgit v1.2.3