summaryrefslogtreecommitdiff
path: root/src/support/bits.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/support/bits.h')
-rw-r--r--src/support/bits.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/support/bits.h b/src/support/bits.h
index 73d71e804..f1dc4364f 100644
--- a/src/support/bits.h
+++ b/src/support/bits.h
@@ -56,30 +56,30 @@ extern template int CountLeadingZeroes(uint64_t);
// Convenience signed -> unsigned. It usually doesn't make much sense to use bit
// functions on signed types.
-template <typename T>
+template<typename T>
int PopCount(T v) {
return PopCount(typename std::make_unsigned<T>::type(v));
}
-template <typename T>
+template<typename T>
int CountTrailingZeroes(T v) {
return CountTrailingZeroes(typename std::make_unsigned<T>::type(v));
}
-template <typename T>
+template<typename T>
int CountLeadingZeroes(T v) {
return CountLeadingZeroes(typename std::make_unsigned<T>::type(v));
}
-template <typename T>
+template<typename T>
bool IsPowerOf2(T v) {
return v != 0 && PopCount(v) == 1;
}
-template <typename T, typename U>
+template<typename T, typename U>
inline static T RotateLeft(T val, U count) {
T mask = sizeof(T) * CHAR_BIT - 1;
count &= mask;
return (val << count) | (val >> (-count & mask));
}
-template <typename T, typename U>
+template<typename T, typename U>
inline static T RotateRight(T val, U count) {
T mask = sizeof(T) * CHAR_BIT - 1;
count &= mask;