I have 2 std::vectors, one float, one integer: A and B.
A = [5,3,1,2]
B = [0.1, 0.2, 0.3, 0.4]
I want to sort A and maintain the same 1-1 in B. So the result should look like:
A = [1,2,3,5]
B = [0.3, 0.4, 0.2, 0.1]
I used python/js convention for convenience, but these are C++ std::vectors. I was considering just making a tuple struct and packing these into a std:vector of tuples, overloading the sort comparator. Is there more lazy way of doing this?