Fix nextPowTwo for 64-bit values under MSVC
[folly.git] / folly / Bits.h
index 3bf1e32954c9d48bf90f1aea30077f86ad4ce7f9..e974c91d3ae46073b21a155a9ab7cb7e5bb1503d 100644 (file)
@@ -185,7 +185,7 @@ typename std::enable_if<
   std::is_integral<T>::value && std::is_unsigned<T>::value,
   T>::type
 nextPowTwo(T v) {
-  return v ? (1ul << findLastSet(v - 1)) : 1;
+  return v ? (T(1) << findLastSet(v - 1)) : 1;
 }
 
 template <class T>