From d24c4eec691053f50704c2edcbca6358179014f2 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 17 Jul 2019 10:57:44 +0200 Subject: [PATCH] Add static assert to ensure T is unsigned. --- pdns/misc.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/pdns/misc.hh b/pdns/misc.hh index 0ead1e41ba..5a8bc2b22b 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -112,6 +112,7 @@ stringtok (Container &container, string const &in, template bool rfc1982LessThan(T a, T b) { + static_assert(std::is_unsigned::value, "rfc1982LessThan only works for unsigned types"); typedef typename std::make_signed::type signed_t; return static_cast(a - b) < 0; } -- 2.47.2