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..