From 3f3043dc1fd8a396c566803cdad4db593c75ba5d Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 11 Feb 2016 16:34:40 -1000 Subject: [PATCH] PopCount fix --- include/Math.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Math.hpp b/include/Math.hpp index ed9b468..fe5ea42 100644 --- a/include/Math.hpp +++ b/include/Math.hpp @@ -96,7 +96,7 @@ namespace Math template inline int PopCount(T x) { - using U = std::conditional_t::value, std::underlying_type_t, T>; + using U = std::make_unsigned_t::value, std::underlying_type_t, T>>; U cx = U(x); const U m1 = U(0x5555555555555555); //binary: 0101... const U m2 = U(0x3333333333333333); //binary: 00110011..