From 6139332979954044191
X-Google-Thread: f78e5,33c1ffa960d55699
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!news2.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: Re: Suggestion: parent
Date: Mon, 16 May 2005 16:18:53 GMT
Lines: 42
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <4282CAE7.30705@usq.edu.au>
References: <4280298A.6090305@usq.edu.au> <2NXfe.4884$eU.970@fed1read07> <20050510120102.A34CF780A4@mscan4.ucar.edu>
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 1116260338 3031 158.152.254.254 (16 May 2005 16:18:58 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 16 May 2005 16:18:58 +0000 (UTC)
X-Abuse: abuse@usq.edu.au
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-Trace: 12 May 2005 13:15:23 +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 j4GGIrKY028526;
	Tue, 17 May 2005 02:18:53 +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++:4751

Hyman Rosen wrote:
> James Dennett wrote:
> 
>> 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.
> 
> 
> It's the MI case where this is most useful, but complicated template
> base classes could use the help as well. I don't see anything all that
> difficult - simply let inherited<N> be the (N+1)th direct base class,
> and let inherited::name be the name found by lookup as if name were not
> defined in the derived class.

Now that's really good! A very nice example of lateral thinking. As I 
understand it, you are saying: We can't uniquely identify the parent, 
but we can pretend we didn't define this name here and see what 
definitions we get from elsewhere.

The same idea would work for ordinary enclosed blocks, suggesting that 
perhaps "inherited" isn't quite the right name. Or perhaps they aren't 
quite the same thing: in an enclosed class, we might want an inherited 
definition or an enclosing definition (ignoring all inherited versions). 
So maybe this implies we need inherited::name and maybe outside::name?

Not that I want to add complexity: I suspect the inherited one is much 
more useful than the outside one, but I am willing to be told that my 
imagination isn't working well enough!

As for inherited<N>, I  think a more useful way to define it would be: 
ask all ancestors for all inherited<N-1> definitions of name.

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



