I am looking for a way to do the following:
std::vector<char> v1{'a', 'z', 'b', 'c'};
std::vector<int> v2{1, 2, 3, 4};
std::special_sort(v1, v2);
// Output:
// v1: a, b, c, z
// v2: 1, 3, 4, 2
So v1
should be aligned by the result of a sort
on v1
.
Is there a function in the standard that does special_sort
?
What is such a sort called?