early-access version 2422

This commit is contained in:
pineappleEA
2022-01-21 04:04:34 +01:00
parent 899ade82ac
commit eb6157eec1
4 changed files with 32 additions and 1 deletions

View File

@@ -45,6 +45,12 @@ template <typename T>
return static_cast<u32>(log2_f + static_cast<u64>((value ^ (1ULL << log2_f)) != 0ULL));
}
template <typename T>
requires std::is_unsigned_v<T>
[[nodiscard]] constexpr bool IsPow2(T value) {
return std::has_single_bit(value);
}
template <typename T>
requires std::is_integral_v<T>
[[nodiscard]] T NextPow2(T value) {