🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #193

Re: What does "::" really mean?

#193
From: David (Lujun) Shang
Date: Fri, 04 Sep 1992 14:06
48 lines
1374 bytes
I'd like to add something to my last post on this subject.

Consider an example:

class AA
{ public:
    class NAA {};
};

class AA1: public AA
{ public:
    class AA
    {  public:
         class NAA{};
    };
};

class AA2: public AA
{ public:
    class AA
    {  public:
         class NAA{};
    };
};

class BB: public AA1, public AA2
{
   AA1::AA::NAA  x;     // what is the type of x???
};

What is the type of member "x" in class BB?

We should use:

   AA1.AA.NAA

to denote the class NAA nested in class AA nested in class AA1, and use

   AA1::AA.NAA

to denote the class NAA nested in the base class AA of AA1.

To conclude, we use"::" to denote a specific base when the member is ambiguous  
due to multiple inheritace, and we use "." to denote the member or property of  
a qualifying entity ( an object or a class ).

David Shang
Technical Details
Message-ID: <1992Sep4.140615.9469@cadsun.corp.mot.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!panther!mothost!motsrd!news
References: <1992Sep4.001405.4117@cadsun.corp.mot.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++
Path: arc1-ca.pugleaf.net!sparky!uunet!panther!mothost!motsrd!news
From: shang@corp.mot.com (David (Lujun) Shang)
Subject: Re: What does "::" really mean?
Message-ID: <1992Sep4.140615.9469@cadsun.corp.mot.com>
Sender: news@cadsun.corp.mot.com
Reply-To: shang@corp.mot.com
Organization: Motorola, Inc., Software Research and Development, Rolling Meadows, IL. 60008
References: <1992Sep4.001405.4117@cadsun.corp.mot.com>
Date: Fri, 4 Sep 92 14:06:15 GMT
Lines: 49