Skip to the content of the web site.

Project Y.4: Ones count

The ones_count function returns the number of 1 bits in the given integer.

std::size_t ones_count( unsigned int value );

Templated

template <typename T>
std::size_t ones_count( T value );