for(int i : SupersetDesc(a, n)){...}
n
a
#pragma once namespace haar_lib { template <typename Func> void enumerate_supersets_desc(int a, int n, const Func &f) { const int x = (1 << n) - 1, y = x ^ (a & x); for (int t = y;; t = (t - 1) & y) { if (not f(t | a)) break; if (t == 0) break; } } } // namespace haar_lib
#line 2 "Mylib/Bit/enumerate_supersets_desc.cpp" namespace haar_lib { template <typename Func> void enumerate_supersets_desc(int a, int n, const Func &f) { const int x = (1 << n) - 1, y = x ^ (a & x); for (int t = y;; t = (t - 1) & y) { if (not f(t | a)) break; if (t == 0) break; } } } // namespace haar_lib