On 10/09/2012 11:23 PM, bearophile wrote:
Andrei Alexandrescu:
Yes, we need next_permutation. It will be up to you to convince the
Grand Inquisition Committee of Reviewers that next_even_permutation is
necessary and/or sufficient.
I don't like the design of C++ STL here. Instead of a
next_permutation(), what about ranges that yield all permutations, all
adjacent permutations, all combinations?
[snip code]
I agree that that's better conceptually, but your implementations have
overflow issues. (And it is not too obvious how to fix that, given the
existing range design.)