7/08/2014

STL vector sort, lambda version


//vector
vector< pair > vote;

//data input
~~
~~

//sort
 sort(vote.begin(), vote.end(), [](const pair& A, const pair& B){ return A.second > B.second; } );

No comments:

Post a Comment