From 1c150f270077fd1a4c8c3daade0aa1e34f651e9a Mon Sep 17 00:00:00 2001 From: bert hubert Date: Mon, 5 Oct 2015 20:34:16 +0200 Subject: [PATCH] little gift for @pieterlexis https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html --- pdns/misc.hh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pdns/misc.hh b/pdns/misc.hh index 11f2526cd..b967ebe5f 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -627,3 +627,10 @@ std::unique_ptr make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } + + +template +const T& defTer(const T& a, const T& b) +{ + return a ? a : b; +} -- 2.40.0