Fix usage of C++14 constexpr in HasZeroOrOneBit
This commit is contained in:
parent
f07e3bd4c9
commit
0fba0b4811
|
@ -77,8 +77,7 @@ namespace nxt {
|
|||
template<typename T>
|
||||
constexpr bool HasZeroOrOneBits(T value) {
|
||||
using Integral = typename UnderlyingType<T>::type;
|
||||
Integral v = static_cast<Integral>(value);
|
||||
return (v & (v - 1)) == 0;
|
||||
return (static_cast<Integral>(value) & (static_cast<Integral>(value) - 1)) == 0;
|
||||
}
|
||||
|
||||
template<typename T1, typename T2, typename = typename std::enable_if<
|
||||
|
|
Loading…
Reference in New Issue