Skip to content

Instantly share code, notes, and snippets.

View michihupf's full-sized avatar
🏳️
resign

michihupf michihupf

🏳️
resign
  • Bavaria, Germany
  • 01:33 (UTC +02:00)
View GitHub Profile
@michihupf
michihupf / bitsubset.cpp
Last active November 29, 2023 21:26
efficient C++ subset impl with pop_lsb() using ctz compiler intrinsics for MSVC, GCC and Clang.
#include <vector>
#include <cassert>
#include <cmath>
#include <iostream>
#if defined _MSC_VER
// include MSVC compiler intrinsics
// for _BitScanForward
#include <intrin.h>