| 149 | |
| 150 | template<typename T> |
| 151 | constexpr int WhichPowerOf2(T x) { |
| 152 | static_assert(std::is_integral<T>::value, "T must be integral"); |
| 153 | // TODO: assert unsigned. There is currently many uses with signed values. |
| 154 | DCHECK((x != 0) && IsPowerOfTwo(x)); |
| 155 | return CTZ(x); |
| 156 | } |
| 157 | |
| 158 | // For rounding integers. |
| 159 | // Note: Omit the `n` from T type deduction, deduce only from the `x` argument. |
nothing calls this directly
no test coverage detected