| 474 | |
| 475 | template <typename T> |
| 476 | inline bool IsPowerOfTwo(T x) { |
| 477 | static_assert(!std::numeric_limits<T>::is_signed, "unsigned types only"); |
| 478 | return x != 0 && (x & (x - 1)) == 0; |
| 479 | } |
| 480 | |
| 481 | // Returns a mask with "bits" number of least significant bits set. |
| 482 | inline uint32 LsbMaskU32(int bits) { |
no outgoing calls
no test coverage detected