Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!rex!samsung!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Bear with me, my stupid question Message-ID: <354@taumet.com> Date: 27 Jul 90 17:08:13 GMT References: <9873@hubcap.clemson.edu> Distribution: usa Organization: Taumetric Corporation, San Diego Lines: 18 grimlok@hubcap.clemson.edu (Mike Percy) writes: |X X::operator +(X& rhs) |{ | // make a temporary copy of the lhs or rhs, withever is larger | X temp(count > rhs.count ? this : rhs); ^^^^ *this | // do stuff with temp | return temp; |} Use '*this' instead of 'this' where indicated. An object of type T may be freely used where one of type T& is expected, and vice versa. Now both sides of the ':' operator have equivalent types. -- Steve Clamage, TauMetric Corp, steve@taumet.com