I have searched for a specific answer for my question and i couldn't find one , so here is my question:
I know that if we have
operator+
andoperator+=
+=
should be a method and+
a non-member function but what if we didn't haveoperator+=
, shouldoperator+
befriend
then ?I also know that symmetrical operators should be 'non-members' and 'friends' if needed , and I can see how
==
!=
are symmetrical operators, but what about<
,>
,>=
,<=
are they symmetric? and why ? I meanA<B
is not the same asB<A
, so are they symmetric? should they be declared as non-members? friends?