Home / list of functions / fwnbi::popcount
template <size_t B, class D>
constexpr size_t popcount(const basic_integer<B, D, false>& value) noexcept;
constexpr since C++14

Calculates count of 1-bits in integer.

Example
#include "fwnbi.hpp"
#include <iostream>

using namespace fwnbi::literals;

int main() {
    std::cout << fwnbi::popcount(15241578750190521_ull128) << '\n';
}
Output
26