aboutsummaryrefslogtreecommitdiffstats
path: root/common/albit.h
diff options
context:
space:
mode:
authorGlyn Leine <[email protected]>2022-03-29 17:46:49 +0200
committerGitHub <[email protected]>2022-03-29 08:46:49 -0700
commita752d920d1899e7ff22748f3eca835525fc85b30 (patch)
treeb994111d94092e31e1d65f9d4f9acc4dedec4db6 /common/albit.h
parentb9ff9fa6d90676e2bb961fae25d83b9e4bbbea93 (diff)
constexpr functions are not allowed to have static variables, and if they are constexpr anyways then them being static has no benifit (#677)
Diffstat (limited to 'common/albit.h')
-rw-r--r--common/albit.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/albit.h b/common/albit.h
index 047caab6..ad596208 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;
- 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)};
+ 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)};
fast_type v{fast_type{val} - ((fast_type{val} >> 1) & b01010101)};
v = (v & b00110011) + ((v >> 2) & b00110011);