0
Default sorting by first member variable of class
As class has all the member variables of int type and C++ knows how to sort int types, why can't class sorting work without < operator ? Try uncommening sort statement and it will throw errors In other words , we have vector<vector<int>> , then C++ by default sorts outer vector based on first element of inner vector. Why this non uniformity https://sololearn.com/compiler-playground/cvj2h8MyefIL/?ref=app
2 Answers
0
maybe because the default behavior is ascending sort, so it needs an overload for < for custom types.
0
Let it do ascending or descending. I was expecting it to not ask for any operator like it is not asking for vector of vector.