Joseph Rushton Wakeling:

How does your desired concept relate to the existing std.algorithm.nextPermutation ... ?

The API of the lazy permutations/combinations ranges is similar to the one I have written here:

That is also very similar to the permutations/combinations here (with the "r" optional argument):

To the one in Phobos is used like:

auto items = [1, 2, 3];
while (items.nextPermutation());

The permutations/combinations range is used like (the boolean template argument is to specify if it has to copy the buffer or not):

[1, 2, 3].permutations!false.writeln;


Reply via email to