MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / bit_width

Function bit_width

external/include/fstd/bit.h:214–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212
213template< class T, typename std::enable_if<std::is_unsigned<T>::value, int >::type = 0 >
214constexpr T bit_width(T x) noexcept
215{
216 return static_cast<T>(std::numeric_limits<T>::digits - countl_zero(x) );
217}
218
219template< class T >
220constexpr T bit_ceil_impl( T x, std::true_type /*case: same type*/)

Callers 2

bit_ceil_implFunction · 0.85
bit_floorFunction · 0.85

Calls 1

countl_zeroFunction · 0.85

Tested by

no test coverage detected