$lowbit(x)=x&(-x)$
$x&(x-1)=x\quad xor\quad lowbit(x)$

1
2
3
4
for(int i=x;;i=(i-1)&x){
...
if(i==0)break;
}

可枚举$x$在二进制下的子集