Comment #0 by bearophile_hugs — 2014-05-16T08:44:41Z
This C++ algorithm is useful in post-conditions and unittests to verify the correctness of sorting, and in other situations:
http://www.cplusplus.com/reference/algorithm/is_permutation/
The Phobos algorithm could be named "isPermutation(x, y)", that returns a boolean.
----------
A related algorithm could return an array of indexes that represent the mapping from the first to the second array.
I am also thinking about a related range that could be named "assumePermutationOf(x, y)" that returns a range like std.range.assumeSorted, but it's not easy to use it well.
Comment #3 by bearophile_hugs — 2015-09-18T08:44:56Z
(In reply to github-bugzilla from comment #2)
> Commits pushed to master at https://github.com/D-Programming-Language/phobos
Lot of work for one algorithm.
The range returned by assumePermutationOf(x, y) is sometimes usueful.
Comment #4 by github-bugzilla — 2015-10-04T18:21:00Z