of elements of which are an indexed view into r.
permutations
fn
Permutations!Range permutations(Range)(Range r)Lazily computes all _permutations of r using Heap's algorithm.
Parameters
Range | the range type |
r | the random access range to find the permutations for. |
Returns
A forward range
Note
The elements of the resulting range reuse the same internal buffer of
permutations, so each element is invalidated by popFront. If copies of intermediate permutations are desired, they need to be individually copied, such as using .map!(e => e.array) to save them in individual, independent arrays.