| 187 | */ |
| 188 | template <typename T> |
| 189 | constexpr uint8_t FindFirstBit(T x) |
| 190 | { |
| 191 | if (x == 0) return 0; |
| 192 | |
| 193 | if constexpr (std::is_enum_v<T>) { |
| 194 | return std::countr_zero<std::underlying_type_t<T>>(x); |
| 195 | } else { |
| 196 | return std::countr_zero(x); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | /** |
| 201 | * Search the last set bit in a value. |
no outgoing calls
no test coverage detected