In the last example, operator overloading is done within the class which is the same as the previous examples. In C++, after overloading the less-than operator (<), standard sorting functions can be used to sort some classes.