diff options
Diffstat (limited to 'common/albit.h')
-rw-r--r-- | common/albit.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/albit.h b/common/albit.h index ad596208..047caab6 100644 --- a/common/albit.h +++ b/common/albit.h @@ -99,10 +99,10 @@ constexpr std::enable_if_t<std::is_integral<T>::value && std::is_unsigned<T>::va int> popcount(T val) noexcept { using fast_type = typename detail_::fast_utype<T>::type; - constexpr fast_type b01010101{detail_::repbits<fast_type>(0x55)}; - constexpr fast_type b00110011{detail_::repbits<fast_type>(0x33)}; - constexpr fast_type b00001111{detail_::repbits<fast_type>(0x0f)}; - constexpr fast_type b00000001{detail_::repbits<fast_type>(0x01)}; + static constexpr fast_type b01010101{detail_::repbits<fast_type>(0x55)}; + static constexpr fast_type b00110011{detail_::repbits<fast_type>(0x33)}; + static constexpr fast_type b00001111{detail_::repbits<fast_type>(0x0f)}; + static constexpr fast_type b00000001{detail_::repbits<fast_type>(0x01)}; fast_type v{fast_type{val} - ((fast_type{val} >> 1) & b01010101)}; v = (v & b00110011) + ((v >> 2) & b00110011); |