🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #82

Re: virtual operator+

#82
From: Robert W Hand
Date: Thu, 16 May 2002 23:23
20 lines
2251 bytes
On Thu, 16 May 2002 21:31:31 GMT, "Daniel T." <notdanielt3@gte.net>
wrote:

>"Christopher Deli" <christopher@delinfo.com> wrote:
>
>>Hello!
>>
>>I have a problem which I'd need some help with, please.
>>If I have one class A which is inherited by another class B i.e. class B :
>>public class A and I would like to make a virtual operator+ in both class A

>What is op+ supposed to return, an "A" object or a "B" object?

Aren't the two return types A and B covariant?  The one in the A class
would return an A object, and the one in the B class would return a B
object.  

Best wishes,

Bob
Technical Details
Message-ID: <ekf8eug9pmpefc11b5uv2t9a37ji28mq6d@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!paloalto-snh1.gtei.net!news.gtei.net!cyclone-sf.pbi.net!151.164.30.35!cyclone.swbell.net!easynews!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin7.nnrp.aus1.giganews.com.POSTED!not-for-mail
References: <5mVE8.38287$n4.8427350@newsc.telia.net> <notdanielt3-34A906.17313116052002@news.bellatlantic.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114592,e2ff40a616ce87ab
X-Google-Attributes: gid114592,public
X-Google-Thread: 109fba,e2ff40a616ce87ab
X-Google-Attributes: gid109fba,public
X-Google-Thread: 10d4ba,e2ff40a616ce87ab
X-Google-Attributes: gid10d4ba,public
X-Google-ArrivalTime: 2002-05-16 16:23:29 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!paloalto-snh1.gtei.net!news.gtei.net!cyclone-sf.pbi.net!151.164.30.35!cyclone.swbell.net!easynews!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin7.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: <ekf8eug9pmpefc11b5uv2t9a37ji28mq6d@4ax.com>
References: <5mVE8.38287$n4.8427350@newsc.telia.net> <notdanielt3-34A906.17313116052002@news.bellatlantic.net>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 20
NNTP-Posting-Date: Thu, 16 May 2002 18:23:11 CDT
Organization: Giganews.Com - Premium News Outsourcing
X-Trace: sv3-T7VIE42PVO86mrRayra1iJMwKi1Zu0Ave25AfRpEtpjsHmP8v8PkXi/N57AZFi49cvRkMMeKDoA5lKi!Fn1fbhm5DAgRnR0UA3uhWX26An8WomEQWod87XXUDzW/Q1nldR0lSRm8OqIOxfnV
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: Thu, 16 May 2002 23:23:11 GMT