🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Scope of fwd declaratoins of nested classes

#2923
From: Gregory Bond
Date: Thu, 14 Dec 1995 04:52
26 lines
1525 bytes
Try this for a corner case:

class A {
  public:
	class B;
  private:
	class B {
	  public:
		int b;
	};
};

// Is A::B visible here? Or is the above declaration ill-formed?
// I.e. is the scope of A::B established when it is declared or when
// it is defined? or should the two scopes be the same?
// FWIW, g++ 2.7.1 thinks this is well-formed and A::B is visible.
	
--
Gregory Bond <gnb@bby.com.au> Burdett Buckeridge & Young Ltd Melbourne Australia
``Efforts to maintain the "purity" of a language only succeed in establishing an
  elite class of people who know the shibboleths.  Ordinary folks know better, 
  even if they don't know what "shibboleth" means.'' - Larry Wall

[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <GNB.95Dec14120500@dame.bby.com.au>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: gnb@bby.com.au (Gregory Bond)
Newsgroups: comp.std.c++
Subject: Scope of fwd declaratoins of nested classes
Date: 14 Dec 1995 04:52:04 GMT
Organization: Burdett, Buckeridge & Young Ltd., Melbourne, Australia
Approved: clamage@eng.sun.com (comp.std.c++)
Distribution: world
Message-ID: <GNB.95Dec14120500@dame.bby.com.au>
NNTP-Posting-Host: taumet.eng.sun.com
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Nntp-Posting-Host: dame.bby.com.au
Content-Length: 679
Originator: clamage@taumet