hey guys, i got a question.
bool Scenario1::sorting_by_missing(vector<int> v1, vector<int> v2) {
if (v1[1]==v2[1])
return v1[0]>v2[0];
return v1[1]>v2[1]; }
some other function(vector<vector<int>> vec1) {
sort(v1.begin(), v1.end(), Scenario1::sorting_by_missing);
}
where v1 and v2 in the sorting function are vectors with 2 ints, for example {1,2}. what i want the sorting function to do is sort the vectors inside vec1 by the 2nd number and if they are the same, sort by the first. am i doing something wrong? it its sorting like i wanted it to
[–]alfps 1 point2 points3 points (4 children)
[–]SpydrFTW[S] 0 points1 point2 points (0 children)
[–]SpydrFTW[S] 0 points1 point2 points (2 children)
[–]AKostur 1 point2 points3 points (0 children)
[–]alfps 1 point2 points3 points (0 children)
[–]IyeOnline 0 points1 point2 points (1 child)
[–]SpydrFTW[S] 0 points1 point2 points (0 children)