From -7526120846562771500
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,1061a88048bb29b2
X-Google-Attributes: gidf78e5,public
X-Google-Thread: 109fba,51c25ee341635166
X-Google-Attributes: gid109fba,public
From: sdk@cci.com (Stephen Knight)
Subject: Re: inherited:: keyword
Date: 1995/05/03
Message-ID: <sdk-0305950904220001@nhmbma3.humb.nt.com>#1/1
X-Deja-AN: 102008546
sender: root@sunsrvr6.cci.com (Operator)
references: <3n4lpp$iks@nkosi.well.com> <D7IBDA.IMv@cix.compulink.co.uk> <3nggfn$sk3@stellar.comnet.com>
organization: Northern Telecom
newsgroups: comp.lang.c++,comp.std.c++

In article <3nggfn$sk3@stellar.comnet.com>, "Brian T. Hill"
<bhil@strata3d.com> wrote:

> xqp@cix.compulink.co.uk ("Martin Jenkins") wrote:
> 
> >> I've come across the following syntax in some mac code,
> >> both metroworks and mac app:
> 
> >> cName::cName()
> >> {
> >> .
> >> .
> >> .
> >> inherited::f();
> >> }
> 
> >> cName is a derived class,
> >> "inherited is not a class name anywhere,
> >> (I searched the entire OS),
> >> and f is a function of the base class.
> 
> >> I assume that this syntax will find the function f
> >> somewhere in the class hierarchy, howver I cannot find any
> >> reference to this syntax anywhere.
> 
> >> Is this something new or some mac extension, or what ?
> 
> >Look at p205 of the 2nd edition of Stroustrup. In the index as 
> >"inherited::".
> 
> I've come across this too.  I've read Stroustrup's suggestion and I 
> understand what it means when I see it.  But when did it become a part 
> of the language per se?  Stroustrup suggests using a typedef to define 
> the keyword, yet Metrowerks seems to use it without the typedef.

Originally, Apple's MPW C++ compiler was modified to allow "handle" based
objects (pointer to a pointer) so that memory could be shuffled around. 
Among the changes necessary to support this, their compiler folks also
created the "inherited" keyword.  It's not part of the "standard"
definition, altho Metrowerks supports it also (note:  I've found some C++
compilers that don't support the "typedef" solution correctly.  they've
got a scoping problem).

> 
> Can we expect to see this in other C++ implementations?  I personally 
> prefer the compiler to define the keyword.  If the programmer defines 
> it, there can be no guarantee that it actually refers to the superclass.

I wouldn't expect it to appear in other implementations.  Welcome to
"standards".

steve knight
northern telecom



