From 7449415579700979857
X-Google-Thread: f78e5,33c1ffa960d55699
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: jdennett@acm.org (James Dennett)
Newsgroups: comp.std.c++
Subject: Re: Suggestion: parent
Date: Tue, 10 May 2005 05:51:17 GMT
Organization: Cox Communications
Lines: 30
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <2NXfe.4884$eU.970@fed1read07>
References: <4280298A.6090305@usq.edu.au>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1115704290 1671 158.152.254.254 (10 May 2005 05:51:30 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 10 May 2005 05:51:30 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041217
X-Accept-Language: en-us, en
X-Virus-Scanned: by amavisd-new at cs.mu.OZ.AU
X-Path: comp-std-cpp-robomod!not-for-mail
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id j4A5pHdV012438;
	Tue, 10 May 2005 15:51:17 +1000 (EST)
X-NNTP-Posting-Date: Tue, 10 May 2005 01:38:06 EDT
X-Delivered-To: std-c++@ucar.edu
X-Authentication-Warning: fed1read07.mgt.cox.net: news set sender to newsmaster@cox.net using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:4683

Ron House wrote:
> I don't know if this has been suggested, but a neat way to refer to the 
> parent of a class would be very useful. Thus, if C inherits from B, 
> "parent" used inside C, would be B. This would be handy with template 
> arguments, and when classes include code from macros or templates that 
> want to mention the ancestor. I ran into the problem when designing a 
> system to automatically generate a collection of classes for writing 
> html from special short descriptions of html elements. My canned code 
> got inserted into various classes and I needed to call ancestor methods. 
> I found I had to keep track of the ancestor class names with complicated 
> macros.
> 

This has been discussed a number of times here:
http://groups-beta.google.com/group/comp.std.c++/browse_thread/thread/bcdfb80dbd695f38/cc4cde7f50c0fd8b?q=comp.std.C%2B%2B+parent&rnum=4#cc4cde7f50c0fd8b
or
http://groups-beta.google.com/group/comp.std.c++/browse_thread/thread/745b8fd5e5fadce3/61758e00b849500f?q=comp.std.C%2B%2B+parent&rnum=6#61758e00b849500f
would be examples.  Names suggested include "super" and "inherited".
In the past the idea hasn't had all that much support, given that
it's not hard to add a typedef manually and that generalizations to
multiple inheritance are either restricted or complicated.

-- James

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



