Use c++20 has_single_bit for POT test

This commit is contained in:
kd-11 2021-08-02 23:06:54 +03:00 committed by kd-11
parent 99b6963fab
commit 8aec943093
2 changed files with 6 additions and 7 deletions

View file

@ -13,6 +13,12 @@ namespace utils
{
return std::span<T>(bless<T>(span.data()), sizeof(U) * span.size() / sizeof(T));
}
template <typename T>
bool is_power_of_2(T value)
{
return std::has_single_bit(value);
}
}
namespace