Math/Algorithm: CountBits now returns a std::size_t instead of a T

This commit is contained in:
Lynix
2016-11-18 01:14:33 +01:00
parent 9513d9479a
commit 964d16f907
2 changed files with 3 additions and 3 deletions

View File

@@ -147,10 +147,10 @@ namespace Nz
template<typename T>
//TODO: Mark as constexpr when supported by all major compilers
/*constexpr*/ inline T CountBits(T value)
/*constexpr*/ inline std::size_t CountBits(T value)
{
// https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan
unsigned int count = 0;
std::size_t count = 0;
while (value)
{
value &= value - 1;