On 10/10/12 00:22, bearophile wrote:
Steven Schveighoffer:

Is there any advantage over having a function?  I'd think you could
easily build a range based on the function, no?

Generators (that yield lexicographic permutations, permutation swaps,
combinations, etc) are quite more handy, you can compose them with the
other ranges and higher order functions.

Adding to Phobos few ranges that build on a next_permutation(),
next_combination(), etc, is possible, but I don't see a big need for
such C++-style functions, the ranges are enough.

What makes you think that permutations are only ever used in a range context? Do you have any evidence for that?

Sounds like an abstraction inversion to me.


Reply via email to