From -5937678720817292088
X-Google-Thread: f78e5,33c1ffa960d55699,start
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: house@usq.edu.au (Ron House)
Newsgroups: comp.std.c++
Subject: Suggestion: parent
Date: Tue, 10 May 2005 04:36:44 GMT
Lines: 21
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <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 1115699809 25821 158.152.254.254 (10 May 2005 04:36:49 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 10 May 2005 04:36:49 +0000 (UTC)
X-Abuse: abuse@usq.edu.au
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-Trace: 10 May 2005 13:22:25 +1000, 139.86.144.166
X-User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217
X-Accept-Language: en-au, en-us, en
X-Virus-Scanned: by amavisd-new at cs.mu.OZ.AU
X-Original-NNTP-Posting-Host: 139.86.144.166
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id j4A4ai3I025375;
	Tue, 10 May 2005 14:36:44 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Delivered-To: std-c++@ucar.edu
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:4682

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.

-- 
Ron House     house@usq.edu.au
               http://www.sci.usq.edu.au/staff/house

---
[ 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                       ]



