Skip to content

Instantly share code, notes, and snippets.

@ReaperUnreal
Created June 19, 2012 02:26
Show Gist options
  • Save ReaperUnreal/2951974 to your computer and use it in GitHub Desktop.
Save ReaperUnreal/2951974 to your computer and use it in GitHub Desktop.
masked flip
int mask = (1 << __popcnt(v)) - 1;
return (~n) & mask;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment