As a non-member function, binary operator <
must take two arguments—one of which must be an object (or a reference to an object) of the class that the overloaded operator is associated with. If y
and z
are String
-class objects or references to String
-class objects, then y < z
is treated as if the call operator<(y, z)
had been written in the program, invoking function operator<
which is declared as follows:
bool operator<( const String &, const String & );