🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Scope of fwd declaratoins of nested classe

#2962
From: Ulf Schuenemann
Date: Thu, 21 Dec 1995 20:05
46 lines
1700 bytes

In article <4apjod$7tp@engnews1.eng.sun.com>, clamage@Eng.Sun.Com (Steve Clamage) writes:
|> In article 95Dec14120500@dame.bby.com.au, gnb@bby.com.au (Gregory Bond) writes:
|> >
|> >class A {
|> >  public:
|> >	class B;
|> >  private:
|> >	class B {
|> >	  public:
|> >		int b;
|> >	};
|> >};
|> 
|> An example just like yours appears in the draft to illustrate the error.

The only way I see to hide the definition of a public nested class
is to put it into a different translation unit.

// public header
class A {
    public:
	class B;
};

// implementation file for class A
class A::B {
    public:
	int b;
};


Ulf Schuenemann

--------------------------------------------------------------------
 ,_.   Ulf Schuenemann
#,  \  Fakultaet fuer Informatik, Technische Universitaet Muenchen, Germany.
 |   > email: schuenem@informatik.tu-muenchen.de
 v=-<  WWW:   http://hphalle2.informatik.tu-muenchen.de/~schuenem/


---
[ 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: <4bbstq$ioa@sunsystem5.informatik.tu-muenchen.de>
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!matt
References: <GNB.95Dec14120500@dame.bby.com.au> <4apjod$7tp@engnews1.eng.sun.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!matt
From: schuenem@informatik.tu-muenchen.de (Ulf Schuenemann)
Newsgroups: comp.std.c++
Subject: Re: Scope of fwd declaratoins of nested classe
Date: 21 Dec 1995 20:05:31 GMT
Organization: Technische Universitaet Muenchen, Germany
Approved: matt@Austern (Matt Austern)
Message-ID: <4bbstq$ioa@sunsystem5.informatik.tu-muenchen.de>
References: <GNB.95Dec14120500@dame.bby.com.au> <4apjod$7tp@engnews1.eng.sun.com>
NNTP-Posting-Host: austern.hip.berkeley.edu