You overload a binary operator with either a nonstatic
member function that has one parameter, or a nonmember function that
has two parameters. Suppose a binary operator
@ is called with
the statement
t @ u, where
t is
an object of type
T, and
u is an
object of type
U. A nonstatic member function that
overloads this operator would have the following form:
return_type operator@(T)
A
nonmember function that overloads the same operator would have the
following form:
return_type operator@(T, U)
An
overloaded binary operator may return any type.