What is the equivalent to __builtin_popcount
as found in GCC and Clang, for MSVC-10?
With this code snippet you get the GCC builtin when building with MSVC :
#ifdef _MSC_VER
# include <intrin.h>
# define __builtin_popcount __popcnt
#endif
(Works from Visual Studio 2008).