What Google is trying to tell you is as follows.
As you know, you can overload one and only one operator '<' for a given type. Let them say it works for you. But imagine that in the future you may need to sort objects of one type according to some other comparison criterion. How do you do this? The only available version of '<' is already accepted.
Of course, you can do this by writing a new named function / comparison functor (not the "<" operator) and explicitly passing it to the sorting algorithm. You can write another 2, 5, 10 of them. You can write as much as you want. This will work. However, at this point in your code there will be obvious asymmetries. One comparison function is implemented as the "operator <". The rest are like different named functions / functors. Is there a good reason for this asymmetry?
Well, maybe. If you have a very well-defined and obvious method of natural sorting that applies to your type, it makes very good sense to implement it as operator '<'. This will be the main method of comparison. And other, auxiliary, less "natural" comparison methods can and should be implemented as named functions. This is normal.
However, what if you do not have such an obvious candidate for a “natural” comparison? In this case, preference is given to one method over another and “wasting” the value of “<operator on an arbitrarily chosen one is not a good idea. In this case, it is recommended to leave the '<' symbol and stick to name functions / functors.
In other words, by overloading '<' you create a “favorite” comparison for this type. If this is what you really want, go ahead and do it. But keep in mind that in many cases creating an artificial and arbitrary “favorite” is not a good idea. Do not rush the process of choosing this favorite. Do not take '<' too early.
source share