MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / IsAbsoluteUint

Function IsAbsoluteUint

Bcore/src/main/cpp/base/bit_utils.h:291–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289
290template <size_t kBits, typename T>
291constexpr bool IsAbsoluteUint(T value) {
292 static_assert(kBits <= BitSizeOf<T>(), "kBits must be <= max.");
293 static_assert(std::is_integral<T>::value, "Needs an integral type.");
294 using unsigned_type = typename std::make_unsigned<T>::type;
295 return (kBits == BitSizeOf<T>())
296 ? true
297 : IsUint<kBits>(value < 0
298 ? static_cast<unsigned_type>(-1 - value) + 1u // Avoid overflow.
299 : static_cast<unsigned_type>(value));
300}
301
302// Generate maximum/minimum values for signed/unsigned n-bit integers
303template <typename T>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected