Article View: alt.comp.lang.learn.c-c++
Article #91Re: virtual operator+
From: Robert W Hand
Date: Fri, 17 May 2002 12:02
Date: Fri, 17 May 2002 12:02
19 lines
2299 bytes
2299 bytes
On Thu, 16 May 2002 23:30:03 GMT, "Victor Bazarov" <vAbazarov@dAnai.com> wrote: > >No. Covariance requires a pointer or a reference. Operator + >returns an object, not a pointer and not a reference. > Thanks for the information; I had forgotten the correct definition. Then his request is impossible as stated. He'll be hung up on the return type. He could define a virtual member function like: virtual void addition(const B& operand, B& result) const; He will need a dynamic cast in the body of the overriding function. Not very pretty. :-( Best wishes, Bob
Technical Details
Message-ID:
<i2r9eu8b19qr2mmgp4q6mlshmm7ckkug0k@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.airnews.net!cabal11.airnews.net!216.166.61.5.MISMATCH!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mailReferences:
<5mVE8.38287$n4.8427350@newsc.telia.net> <notdanielt3-34A906.17313116052002@news.bellatlantic.net> <ekf8eug9pmpefc11b5uv2t9a37ji28mq6d@4ax.com> <%hXE8.41120$UV4.7489@rwcrnsc54>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4ba,e2ff40a616ce87ab X-Google-Attributes: gid10d4ba,public X-Google-Thread: 114592,e2ff40a616ce87ab X-Google-Attributes: gid114592,public X-Google-Thread: 109fba,e2ff40a616ce87ab X-Google-Attributes: gid109fba,public X-Google-ArrivalTime: 2002-05-17 05:02:58 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.airnews.net!cabal11.airnews.net!216.166.61.5.MISMATCH!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Robert W Hand <rwhand@NOSPAMoperamail.com> Newsgroups: alt.comp.lang.learn.c-c++,att.lang.c++,comp.lang.c++ Subject: Re: virtual operator+ Message-ID: <i2r9eu8b19qr2mmgp4q6mlshmm7ckkug0k@4ax.com> References: <5mVE8.38287$n4.8427350@newsc.telia.net> <notdanielt3-34A906.17313116052002@news.bellatlantic.net> <ekf8eug9pmpefc11b5uv2t9a37ji28mq6d@4ax.com> <%hXE8.41120$UV4.7489@rwcrnsc54> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 19 NNTP-Posting-Date: Fri, 17 May 2002 07:02:40 CDT Organization: Giganews.Com - Premium News Outsourcing X-Trace: sv3-bT1vz/NVlAFUDx8xRs7pCZcpCqovhwWfEg06ElZrggl3Abb6fMJC7hj7cf2/xOJ1XpBInbx+XlT5J9c!C+omES/tV4etnnCKFrGlxzf9e7FpMu70QgfyvRcO6pjE78eEY25mPH3rmpfBPjLz X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly Date: Fri, 17 May 2002 12:02:40 GMT