Possible Duplicate:
How do I sort a vector of pairs based on the second element of the pair?
I have a vector of this type: vector< pair<float, int> > vect;
I want sort its elements according to the descending order of the floats values (the first value of pairs).
For example vect = [<8.6, 4>, <5.2, 9>, <7.1, 23>]
, after sorting I want to have: [<5.2, 9>, <7.1, 23>, <8.6, 4>]
how can I simply do that in C++ ?