🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: virtual operator+

#80
From: Daniel T.
Date: Thu, 16 May 2002 21:31
23 lines
1993 bytes
"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
>and B so I could do the following:
>A *a, *b, *c
>a = new B(...)
>b = new B(...)
>c = new B(...)
>*c = *a + *b
>So I make a pointer of type A which points on an objekt of type B. For that
>I'd need a virtual operator+ but I have no idea how to make it. Please help!
>The source code of a program which has the similar situation would be
>perfekt! Thanks!

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

-- 
Improve your company's understanding of objects...
Hire me. <http://home1.gte.net/danielt3/resume.html>
Technical Details
Message-ID: <notdanielt3-34A906.17313116052002@news.bellatlantic.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!cyclone1.gnilink.net!spamfinder.gnilink.net!nwrddc04.gnilink.net.POSTED!3fa03609!not-for-mail
References: <5mVE8.38287$n4.8427350@newsc.telia.net>

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: 109fba,e2ff40a616ce87ab
X-Google-Attributes: gid109fba,public
X-Google-Thread: 114592,e2ff40a616ce87ab
X-Google-Attributes: gid114592,public
X-Google-ArrivalTime: 2002-05-16 14:31:32 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-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!cyclone1.gnilink.net!spamfinder.gnilink.net!nwrddc04.gnilink.net.POSTED!3fa03609!not-for-mail
From: "Daniel T." <notdanielt3@gte.net>
Newsgroups: alt.comp.lang.learn.c-c++,att.lang.c++,comp.lang.c++
Subject: Re: virtual operator+
References: <5mVE8.38287$n4.8427350@newsc.telia.net>
User-Agent: MT-NewsWatcher/3.1 (PPC)
Message-ID: <notdanielt3-34A906.17313116052002@news.bellatlantic.net>
Lines: 23
Date: Thu, 16 May 2002 21:31:31 GMT
NNTP-Posting-Host: 204.120.3.2
X-Complaints-To: abuse@verizon.net
X-Trace: nwrddc04.gnilink.net 1021584691 204.120.3.2 (Thu, 16 May 2002 17:31:31 EDT)
NNTP-Posting-Date: Thu, 16 May 2002 17:31:31 EDT