From afbfd0e78176d47c495a29c795fbd3690fa0ded3 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Thu, 3 Apr 2025 23:18:51 +0200 Subject: Add numeric library --- asl/base/bit.hpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'asl/base/bit.hpp') 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 -constexpr bool is_pow2(T x) -{ - using unsigned_type = select_t, T, as_unsigned_integer>; - return x > 0 && has_single_bit(static_cast(x)); -} - constexpr int popcount(uint8_t v) { v = v - ((v >> 1) & 0x55); -- cgit