Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!emory!hubcap!grimlok From: grimlok@hubcap.clemson.edu (Mike Percy) Newsgroups: comp.lang.c++ Subject: Bear with me, my stupid question Message-ID: <9873@hubcap.clemson.edu> Date: 26 Jul 90 20:32:28 GMT Distribution: usa Organization: Clemson University, Clemson, SC Lines: 30 If I've declared something as class X { int count; public: X(X& another_X); // construct a new X from an old X X operator +(X& rhs); : } and I have X X::operator +(X& rhs) { // make a temporary copy of the lhs or rhs, withever is larger X temp(count > rhs.count ? this : rhs); // do stuff with temp return temp; } This causes problems as this is of type X *this and rhs is of type X& rhs I don't want to write it as X X::operator +(X *rhs) because I want to do stuff like X a, b, c; c = a + b; // don't want to have to do c = a + &b; How do I properly get a X& from X *this?