In this case I would suggest std::next_permutation, which does exactly that. I have...
Thank you very much for your support. What I was looking for is your second example,...
Permutations with repetitions