diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-04-01 00:39:24 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-04-03 00:34:54 +0200 |
commit | 0776012d0942537b1ddfef13cd37f8bfb125f501 (patch) | |
tree | 8df94c6ac1e41d8116a196b52852ca29efb76b12 /asl/base/utility.hpp | |
parent | 4f8cbd442a1b7805decaf4db7226075221655083 (diff) |
Add bit library
Diffstat (limited to 'asl/base/utility.hpp')
-rw-r--r-- | asl/base/utility.hpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/asl/base/utility.hpp b/asl/base/utility.hpp index 85c873d..77ccc6b 100644 --- a/asl/base/utility.hpp +++ b/asl/base/utility.hpp @@ -47,9 +47,6 @@ template<typename T> namespace asl { -struct in_place_t {}; -static constexpr in_place_t in_place{}; - template<moveable T> constexpr void swap(T& a, T& b) { @@ -84,27 +81,6 @@ constexpr T max(T a, T b) return (a >= b) ? a : b; } -constexpr uint64_t round_up_pow2(uint64_t v) -{ - ASL_ASSERT(v <= 0x8000'0000'0000'0000); - - v -= 1; - - v |= v >> 1U; - v |= v >> 2U; - v |= v >> 4U; - v |= v >> 8U; - v |= v >> 16U; - v |= v >> 32U; - - return v + 1; -} - -constexpr bool is_pow2(isize_t v) -{ - return v > 0 && ((v - 1) & v) == 0; // NOLINT -} - // NOLINTBEGIN(*-macro-parentheses) #define ASL_DELETE_COPY(T) \ T(const T&) = delete; \ |