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

Function JAVASTYLE_CTZ

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

Source from the content-addressed store, hash-verified

78// Similar to CTZ except that on zero input it returns bitwidth and supports signed integers.
79template<typename T>
80constexpr int JAVASTYLE_CTZ(T x) {
81 static_assert(std::is_integral<T>::value, "T must be integral");
82 using unsigned_type = typename std::make_unsigned<T>::type;
83 return (x == 0) ? BitSizeOf<T>() : CTZ(static_cast<unsigned_type>(x));
84}
85
86// Return the number of 1-bits in `x`.
87template<typename T>

Callers

nothing calls this directly

Calls 1

CTZFunction · 0.85

Tested by

no test coverage detected