Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!ut-emx!nowhere!sking From: sking@nowhere.uucp (Steven King) Newsgroups: comp.lang.c++ Subject: Re: friend operator +(l,r) vs. operator +(r) ( oops! ) Message-ID: <1990Nov30.050449.2570@nowhere.uucp> Date: 30 Nov 90 05:04:49 GMT Organization: nowhere Lines: 35 In article <1990Nov29.023619.29838@nowhere.uucp> I wrote: > Various people have responded to various aspects of the original post; I > think it is worth pointing out that under Cfront, for binary operators > returning an instance of a class, one can put the body of the actual > function in the corresponding assignment operator and define the binary > operator as an inline that creates a temporary and assigns it the value > of one of the binary args, then applies the assignment operator against > the temporary and the remaining binary arg, returning the temporary. > This DOES NOT result in a dangling reference, even if the translator can > not inline the expression. ie., > the line > inline friend point &operator + ( point &, point & ); should read inline friend point operator + ( point &, point & ) ; and the reason I couldnt find anything in the ARM, etc., is that I was completely confused about what was going on. time to crawl back under my rock.... merely trying to live up to my .signature \ | v -- sking@nowhere | better to remain unseen ..!cs.utexas.edu!ut-emx!nowhere!sking | and be thought a fool | than to post | and remove all doubt...