Megatech


is_pow2

#include <concepts>

constexpr bool is_pow2(std::unsigned_integral auto x) {
  return x && !(x & (x - 1));
}