47 constexpr static u32 bitcount =
sizeof(T) * 8;
51 std::bitset<bitcount> max;
53 std::bitset<bitcount> current;
58 : offset(tmin), tmax(tmax - tmin), max(tmax - tmin), current(0) {
60 done = !(tmin < tmax);
62 for (firstbit = bitcount - 1; firstbit >= 0; firstbit--) {
69 bool is_done() {
return done; }
77 T get() {
return current.to_ullong() + offset; }
83 int pointer = firstbit;
84 while (carry && !done) {
85 if (current[pointer]) {
86 current.flip(pointer);
93 current.flip(pointer);
96 }
while (current.to_ullong() >= tmax);