Define BitVector::BitWord as uintptr_t instead of unsigned long, as long does not necessarily translates to a pointer size (especially on 64-bit Visual Studio).
It is no cleanup, but the same change. It used to be unsigned long, and therefore the numbers (changed) had the suffix UL (unsigned long). As there is no appropriate suffix for size_t, we need to apply casting instead.
I think the point i was making was missed.
OK, as there are already other places, in the current version, where the cast to BitWord is made, then this sounds reasonable. Is there a way to post 2 patches in a single review using Phabricator? Or should I open a separate review?
Some intrinsics only available for specific architectures. For example, on Windows, _BitScanReverse64 is only available in a 64-bit build (refer to LeadingZerosCounter<T,8> in MathExtras.h).
This looks like progress to me. I personally would go with size_t even despite the (theoretical IMO) concern about size_t being a different size, but either way works for me, and both are better than ulong.