| 314 | |
| 315 | template <typename T> |
| 316 | constexpr T MinInt(size_t bits) { |
| 317 | DCHECK(std::is_unsigned<T>::value || bits > 0) << "bits cannot be zero for signed."; |
| 318 | DCHECK_LE(bits, BitSizeOf<T>()); |
| 319 | return bits == BitSizeOf<T>() |
| 320 | ? std::numeric_limits<T>::min() |
| 321 | : std::is_signed<T>::value |
| 322 | ? ((bits == 1u) ? -1 : static_cast<T>(-1) - MaxInt<T>(bits)) |
| 323 | : static_cast<T>(0); |
| 324 | } |
| 325 | |
| 326 | // Returns value with bit set in lowest one-bit position or 0 if 0. (java.lang.X.lowestOneBit). |
| 327 | template <typename kind> |
nothing calls this directly
no outgoing calls
no test coverage detected