For example: in a C++ header file, if I defined a struct Record and I would like to use it for possible sorting so that I want to overload the less operator>
struct Record
less operator>
The best way to define the less operator is:
struct Record{ (...) const bool operator < ( const Record &r ) const{ return ( num < r.num ); } };