sort tupple cpp code example
Example: sort tuple c++
vector<tuple<int,int,int>> v;
v.push_back({2,1,4});
v.push_back({1,5,3});
v.push_back({2,1,3});
sort(v.begin(), v.end());
//the order of the tuples is (1,5,3), (2,1,3) and (2,1,4).
vector<tuple<int,int,int>> v;
v.push_back({2,1,4});
v.push_back({1,5,3});
v.push_back({2,1,3});
sort(v.begin(), v.end());
//the order of the tuples is (1,5,3), (2,1,3) and (2,1,4).