Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: friend operator +(l,r) vs. operator +(r) Message-ID: <59437@microsoft.UUCP> Date: 30 Nov 90 00:12:21 GMT References: <11759@hubcap.clemson.edu> <1990Nov21.053431.22340@actrix.co.nz> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 16 Koenig has a good discussion of this and other frequent C++ questions in November's JOOP. He points out that symmetric operators should _be_ symmetric. Using members: l + r; is equivalent to l.operator+(r); which clarifies the assymmetry. Using friends instead this becomes: operator+(l, r); maintaining symmetry [both l and r are parameters treated similarly.] Conversely, non-symmetric operators need not be friends.