diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-04-03 23:18:51 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-04-03 23:27:39 +0200 |
commit | afbfd0e78176d47c495a29c795fbd3690fa0ded3 (patch) | |
tree | 9dd644166d5326f54de3492a4048e041c9b0ad66 /asl/base/bit.hpp | |
parent | 0776012d0942537b1ddfef13cd37f8bfb125f501 (diff) |
Add numeric libraryv0.3.0
Diffstat (limited to 'asl/base/bit.hpp')
-rw-r--r-- | asl/base/bit.hpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/asl/base/bit.hpp b/asl/base/bit.hpp index f2e3f61..5056383 100644 --- a/asl/base/bit.hpp +++ b/asl/base/bit.hpp @@ -15,14 +15,6 @@ constexpr bool has_single_bit(is_unsigned_integer auto x) return x != 0 && ((x - 1) & x) == 0; } -// @Todo Move this to numeric library -template<is_integer T> -constexpr bool is_pow2(T x) -{ - using unsigned_type = select_t<is_unsigned_integer<T>, T, as_unsigned_integer<T>>; - return x > 0 && has_single_bit(static_cast<unsigned_type>(x)); -} - constexpr int popcount(uint8_t v) { v = v - ((v >> 1) & 0x55); |