diff options
author | Benjamin Barenblat <bbaren@google.com> | 2023-05-08 12:51:08 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@google.com> | 2023-05-08 12:51:08 -0400 |
commit | c15cec707b1c7d847e59d2db4d0b82b711a7ee6d (patch) | |
tree | 79f448d5bbc8cf52917b0b091f0e1ab60a419c85 /absl/numeric/bits.h | |
parent | f4f2c1da90c4e6a0683c4e66c0268baa1b79cdf3 (diff) | |
parent | c2435f8342c2d0ed8101cb43adfd605fdc52dca2 (diff) | |
download | abseil-c15cec707b1c7d847e59d2db4d0b82b711a7ee6d.tar.gz abseil-c15cec707b1c7d847e59d2db4d0b82b711a7ee6d.tar.bz2 abseil-c15cec707b1c7d847e59d2db4d0b82b711a7ee6d.zip |
Merge new upstream LTS 20230125.3
Diffstat (limited to 'absl/numeric/bits.h')
-rw-r--r-- | absl/numeric/bits.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/absl/numeric/bits.h b/absl/numeric/bits.h index 628cdf50..df81b9a9 100644 --- a/absl/numeric/bits.h +++ b/absl/numeric/bits.h @@ -131,10 +131,9 @@ has_single_bit(T x) noexcept { // fractional part discarded. template <class T> ABSL_INTERNAL_CONSTEXPR_CLZ inline - typename std::enable_if<std::is_unsigned<T>::value, T>::type + typename std::enable_if<std::is_unsigned<T>::value, int>::type bit_width(T x) noexcept { - return std::numeric_limits<T>::digits - - static_cast<unsigned int>(countl_zero(x)); + return std::numeric_limits<T>::digits - countl_zero(x); } // Returns: If x == 0, 0; otherwise the maximal value y such that |