From: bert hubert Date: Mon, 5 Oct 2015 18:34:16 +0000 (+0200) Subject: little gift for @pieterlexis https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c150f270077fd1a4c8c3daade0aa1e34f651e9a;p=pdns little gift for @pieterlexis https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html --- 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; +}