How to implement the algorithm in C++? The task such, there is a bitset size N. Need to consistently go through all the bitset overhang k = 1,2, ... l, until the total number of sequences is not equal to M. That is, The result should be an array:
0 ... 001
0 ... 010
0 ... 100
...
1 ... 000
0 ... 011
0 ... 101
0 ... 110
....
....
etc
With a weight of 1 clear bitwise shift to the left. But how to handle the bitset with weight k = 2,3, ... while maintaining the mass of the algorithm I do not know. please help, can someone faced a similar challenge. Bitset implemented using boost :: dynamic_bitset. The C++ language.