This means that when I sort v2 in non-increasing order, v1 should look like this:
The vectors are as follows.
v1 = {0, 5, 5, 2, 10}; v2 = {0 ,2, 6, 20, 5};
Exit:
v1 = {2, 5, 10, 5, 0}; v2 = {20, 6, 5, 2, 0};
I tried to solve this problem of mixing std::sort and lambdas. This is why I read a few questions about std::sort , there were no answers that solve a problem similar to mine, so I ask.
I am particularly interested in answers containing its use or other features of C ++ 11 and C ++ 14.
It's not a question:
"I totally don't know what to do."
I know how to achieve results using C ++ 98, but I am wondering if there is a more efficient and beautiful way to do this.
Many thanks for the help:)